include the built files for testling

This commit is contained in:
Thomas Aylott committed 2013-11-06 15:30:49 -05:00
1 parent 5640d641d6
commit 1393e55d53
4 files changed
+14679

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
//# sourceURL=populist/loader.js
(function(entries, sources) {
var modules = {};
var hasOwn = modules.hasOwnProperty;
var global = Function("return this")();
var doc = global.document;
var head = doc.documentElement.firstChild;
function internalRequire(id) {
var module = getModule(id);
if (module && !hasOwn.call(module, "exports")) {
module(function(rid) {
return internalRequire(absolutize(id, rid));
}, module.exports = {}, module, global);
// If the module id has a non-null value in the entries object,
// define a global reference to its exports object.
var globalName = entries[id];
if (globalName && hasOwn.call(entries, id))
global[globalName] = module.exports;
}
return module.exports;
}
function getModule(id) {
if (!hasOwn.call(modules, id)) {
if (hasOwn.call(sources, id)) {
var name = "module$" + Math.random().toString(36).slice(2);
var script = doc.createElement("script");
var code = "function " + name + "(require,exports,module,global){" +
sources[id] + "\n}\n//# sourceURL=" + id + ".js\n";
script.setAttribute("type", "text/javascript");
script.setAttribute("encoding", "utf8");
script.appendChild(doc.createTextNode(code));
head.appendChild(script);
modules[id] = global[name];
} else {
throw new Error("Missing module: " + id);
}
}
return modules[id];
}
var pathNormExp = /\/(\.?|[^\/]+\/\.\.)\//;
function absolutize(id, rid) {
if (rid.charAt(0) === ".") {
rid = "/" + id + "/../" + rid;
while (rid != (id = rid.replace(pathNormExp, "/")))
rid = id;
rid = rid.replace(/^\//, "");
}
return rid;
}
// Eagerly require all identifiers that are keys of the entries object.
for (var id in entries)
if (hasOwn.call(entries, id))
internalRequire(id);
})({"jasmine":"jasmine","all":null},{
"jasmine":"/**\n * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.\n *\n * @namespace\n */\nvar jasmine = {};\nexports = module.exports = jasmine;\n/**\n * @private\n */\njasmine.unimplementedMethod_ = function() {\n throw new Error(\"unimplemented method\");\n};\n\n/**\n * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just\n * a plain old variable and may be redefined by somebody else.\n *\n * @private\n */\njasmine.undefined = jasmine.___undefined___;\n\n/**\n * Show diagnostic messages in the console if set to true\n *\n */\njasmine.VERBOSE = false;\n\n/**\n * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.\n *\n */\njasmine.DEFAULT_UPDATE_INTERVAL = 250;\n\n/**\n * Maximum levels of nesting that will be included when an object is pretty-printed\n */\njasmine.MAX_PRETTY_PRINT_DEPTH = 40;\n\n/**\n * Default timeout interval in milliseconds for waitsFor() blocks.\n */\njasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;\n\n/**\n * By default exceptions thrown in the context of a test are caught by jasmine so that it can run the remaining tests in the suite.\n * Set to false to let the exception bubble up in the browser.\n *\n */\njasmine.CATCH_EXCEPTIONS = true;\n\njasmine.getGlobal = function() {\n function getGlobal() {\n return this;\n }\n\n return getGlobal();\n};\n\n/**\n * Allows for bound functions to be compared. Internal use only.\n *\n * @ignore\n * @private\n * @param base {Object} bound 'this' for the function\n * @param name {Function} function to find\n */\njasmine.bindOriginal_ = function(base, name) {\n var original = base[name];\n if (original.apply) {\n return function() {\n return original.apply(base, arguments);\n };\n } else {\n // IE support\n return jasmine.getGlobal()[name];\n }\n};\n\njasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');\njasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');\njasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');\njasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');\n\njasmine.MessageResult = function(values) {\n this.type = 'log';\n this.values = values;\n this.trace = new Error(); // todo: test better\n};\n\njasmine.MessageResult.prototype.toString = function() {\n var text = \"\";\n for (var i = 0; i < this.values.length; i++) {\n if (i > 0) text += \" \";\n if (jasmine.isString_(this.values[i])) {\n text += this.values[i];\n } else {\n text += jasmine.pp(this.values[i]);\n }\n }\n return text;\n};\n\njasmine.ExpectationResult = function(params) {\n this.type = 'expect';\n this.matcherName = params.matcherName;\n this.passed_ = params.passed;\n this.expected = params.expected;\n this.actual = params.actual;\n this.message = this.passed_ ? 'Passed.' : params.message;\n\n var trace = (params.trace || new Error(this.message));\n this.trace = this.passed_ ? '' : trace;\n};\n\njasmine.ExpectationResult.prototype.toString = function () {\n return this.message;\n};\n\njasmine.ExpectationResult.prototype.passed = function () {\n return this.passed_;\n};\n\n/**\n * Getter for the Jasmine environment. Ensures one gets created\n */\njasmine.getEnv = function() {\n var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();\n return env;\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isArray_ = function(value) {\n return jasmine.isA_(\"Array\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isString_ = function(value) {\n return jasmine.isA_(\"String\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isNumber_ = function(value) {\n return jasmine.isA_(\"Number\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param {String} typeName\n * @param value\n * @returns {Boolean}\n */\njasmine.isA_ = function(typeName, value) {\n return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';\n};\n\n/**\n * Pretty printer for expecations. Takes any object and turns it into a human-readable string.\n *\n * @param value {Object} an object to be outputted\n * @returns {String}\n */\njasmine.pp = function(value) {\n var stringPrettyPrinter = new jasmine.StringPrettyPrinter();\n stringPrettyPrinter.format(value);\n return stringPrettyPrinter.string;\n};\n\n/**\n * Returns true if the object is a DOM Node.\n *\n * @param {Object} obj object to check\n * @returns {Boolean}\n */\njasmine.isDomNode = function(obj) {\n return obj.nodeType > 0;\n};\n\n/**\n * Returns a matchable 'generic' object of the class type. For use in expecations ofLine truncated
"all":"require(\"./phantom\");\nrequire(\"./console\");\n\n// TODO Also bundle jasmine.css here.\nvar jasmine = require(\"./jasmine\");\nrequire(\"./jasmine-html\");\nrequire(\"./jasmine-support\");\n\nrequire(\"./HtmlReporter\");\nrequire(\"./PrintReporter\");\nrequire(\"./ReporterView\");\nrequire(\"./SpecView\");\nrequire(\"./SuiteView\");\n\nvar env = jasmine.getEnv();\nenv.addReporter(new jasmine.HtmlReporter);\nenv.addReporter(new jasmine.PrintReporter);\n\nfunction exposeFrom(obj) {\n obj.spyOn = jasmine.spyOn;\n obj.it = jasmine.it;\n obj.xit = jasmine.xit;\n obj.expect = jasmine.expect;\n obj.runs = jasmine.runs;\n obj.waits = jasmine.waits;\n obj.waitsFor = jasmine.waitsFor;\n obj.beforeEach = jasmine.beforeEach;\n obj.afterEach = jasmine.afterEach;\n obj.describe = jasmine.describe;\n obj.xdescribe = jasmine.xdescribe;\n obj.jasmine = jasmine;\n return obj;\n}\njasmine.exposeFrom = exposeFrom;\nvar global = Function(\"return this\")();\nexposeFrom(global);\n\nmodule.exports = jasmine;\n",
"phantom":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * This module provides a bridge from content-land to phantom-land via the\n * window.callPhantom interface.\n */\n\nvar console = require(\"./console\");\nvar global = Function(\"return this\")();\n\nif (global.callPhantom) {\n // Phantom's onConsoleMessage support is lacking (only one argument\n // supported, and it must be a string), so we use callPhantom to\n // forward console messages instead.\n console.addListener(function(method, args) {\n global.callPhantom({\n type: \"console\",\n method: method,\n args: args\n });\n });\n\n exports.exit = function(code) {\n global.callPhantom({\n type: \"exit\",\n code: code\n });\n };\n\n} else {\n exports.exit = function() {};\n}\n",
"console":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * This module allows interception of console.* method calls, so that\n * listeners other than the native console object can consume logged\n * messages.\n */\n\nvar global = Function(\"return this\")();\nvar Ap = Array.prototype;\nvar slice = Ap.slice;\n\nvar nativeConsole;\nif (\"console\" in global) {\n var gc = global.console;\n try { delete global.console } catch (ignored) {}\n nativeConsole = global.console || gc;\n global.console = gc;\n}\n\n// Provide a reliable console interface in all browsers.\nglobal.console = exports;\n\nfunction makeLogger(method) {\n var logger = exports[method] = function() {\n var args = slice.call(arguments);\n listeners.forEach(function(listener) {\n listener(method, args, logger);\n });\n };\n}\n\nmakeLogger(\"info\");\nmakeLogger(\"log\");\nmakeLogger(\"debug\");\nmakeLogger(\"warn\");\nmakeLogger(\"error\");\nmakeLogger(\"dir\");\nmakeLogger(\"dirxml\");\nmakeLogger(\"trace\");\nmakeLogger(\"assert\");\nmakeLogger(\"count\");\nmakeLogger(\"markTimeline\");\nmakeLogger(\"profile\");\nmakeLogger(\"profileEnd\");\nmakeLogger(\"time\");\nmakeLogger(\"timeEnd\");\nmakeLogger(\"timeStamp\");\nmakeLogger(\"group\");\nmakeLogger(\"groupCollapsed\");\nmakeLogger(\"groupEnd\");\nmakeLogger(\"clear\");\n\nvar listeners = [];\nfunction addListener(listener) {\n listeners.push(listener);\n}\nexports.addListener = addListener\n\nfunction clean(arg) {\n if (typeof arg === \"string\") {\n // Remove any xterm-color escape sequences.\n // TODO Display colors in console if possible.\n arg = arg.replace(/\\033\\[\\d+m/g, \"\");\n }\n return arg;\n}\n\nif (nativeConsole) {\n // If present, the native console object becomes a listener just like\n // any other.\n addListener(function(method, args) {\n var method = nativeConsole[method];\n if (method) {\n method.apply(nativeConsole, args.map(clean));\n } else {\n // Ignore this call.\n }\n });\n}\n",
"jasmine-html":"var jasmine = require(\"./jasmine\");\n\njasmine.HtmlReporterHelpers = {};\n\njasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {\n var el = document.createElement(type);\n\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n\n if (typeof child === 'string') {\n el.appendChild(document.createTextNode(child));\n } else {\n if (child) {\n el.appendChild(child);\n }\n }\n }\n\n for (var attr in attrs) {\n if (attr == \"className\") {\n el[attr] = attrs[attr];\n } else {\n el.setAttribute(attr, attrs[attr]);\n }\n }\n\n return el;\n};\n\njasmine.HtmlReporterHelpers.getSpecStatus = function(child) {\n var results = child.results();\n var status = results.passed() ? 'passed' : 'failed';\n if (results.skipped) {\n status = 'skipped';\n }\n\n return status;\n};\n\njasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {\n var parentDiv = this.dom.summary;\n var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';\n var parent = child[parentSuite];\n\n if (parent) {\n if (typeof this.views.suites[parent.id] == 'undefined') {\n this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);\n }\n parentDiv = this.views.suites[parent.id].element;\n }\n\n parentDiv.appendChild(childElement);\n};\n\n\njasmine.HtmlReporterHelpers.addHelpers = function(ctor) {\n for(var fn in jasmine.HtmlReporterHelpers) {\n ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];\n }\n};\n\njasmine.HtmlReporter = function(_doc) {\n var self = this;\n var doc = _doc || window.document;\n\n var reporterView;\n\n var dom = {};\n\n // Jasmine Reporter Public Interface\n self.logRunningSpecs = false;\n\n self.reportRunnerStarting = function(runner) {\n var specs = runner.specs() || [];\n\n if (specs.length == 0) {\n return;\n }\n\n createReporterDom(runner.env.versionString());\n doc.body.appendChild(dom.reporter);\n setExceptionHandling();\n\n reporterView = new jasmine.HtmlReporter.ReporterView(dom);\n reporterView.addSpecs(specs, self.specFilter);\n };\n\n self.reportRunnerResults = function(runner) {\n reporterView && reporterView.complete();\n };\n\n self.reportSuiteResults = function(suite) {\n reporterView.suiteComplete(suite);\n };\n\n self.reportSpecStarting = function(spec) {\n if (self.logRunningSpecs) {\n self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');\n }\n };\n\n self.reportSpecResults = function(spec) {\n reporterView.specComplete(spec);\n };\n\n self.log = function() {\n var console = jasmine.getGlobal().console;\n if (console && console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n console.log(arguments); // ie fix: console.log.apply doesn't exist on ie\n }\n }\n };\n\n self.specFilter = function(spec) {\n if (!focusedSpecName()) {\n return true;\n }\n\n return spec.getFullName().indexOf(focusedSpecName()) === 0;\n };\n\n return self;\n\n function focusedSpecName() {\n var specName;\n\n (function memoizeFocusedSpec() {\n if (specName) {\n return;\n }\n\n var paramMap = [];\n var params = jasmine.HtmlReporter.parameters(doc);\n\n for (var i = 0; i < params.length; i++) {\n var p = params[i].split('=');\n paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);\n }\n\n specName = paramMap.spec;\n })();\n\n return specName;\n }\n\n function createReporterDom(version) {\n dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },\n dom.banner = self.createDom('div', { className: 'banner' },\n self.createDom('span', { className: 'title' }, \"Jasmine \"),\n self.createDom('span', { className: 'version' }, version)),\n\n dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),\n dom.alert = self.createDom('div', {className: 'alert'},\n self.createDom('span', { className: 'exceptions' },\n self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),\n self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),\n dom.results = self.createDom('div', {className: 'results'},\n dom.summary = self.createDom('div', { className: 'summary' }),\n dom.details = self.createDom('div', { id: 'details' }))\n );\n }\n\n function noTryCatch() {\n return window.location.search.match(/catch=false/);\n }\n\n function searchWithCatch() {\n var params = jasmine.HtmlReporter.parameters(window.document);\n var removed = false;\n var i = 0;\n\n while (!removed && i < params.length) {\n if (params[i].match(/catch=/)) {\n params.splice(i, 1);\n rLine truncated
"jasmine-support":"var jasmine = require(\"./jasmine\");\nvar spec = false; // TODO\n\n// Add some matcher for mock functions\njasmine.getEnv().beforeEach(function() {\n this.addMatchers({\n toBeCalled: function() {\n if (this.actual.mock === undefined) {\n throw Error('toBeCalled() should be used on a mock function');\n }\n return this.actual.mock.calls.length !== 0;\n },\n\n lastCalledWith: function() {\n if (this.actual.mock === undefined) {\n throw Error('toBeCalled() should be used on a mock function');\n }\n var calls = this.actual.mock.calls;\n var args = Array.prototype.slice.call(arguments);\n return this.env.equals_(calls[calls.length - 1], args);\n },\n\n toBeCalledWith: function() {\n if (this.actual.mock === undefined) {\n throw Error('toBeCalled() should be used on a mock function');\n }\n var args = Array.prototype.slice.call(arguments);\n return this.actual.mock.calls.some(function(call) {\n return this.env.equals_(call, args);\n }.bind(this));\n }\n });\n});\n\nvar _it = jasmine.Env.prototype.it;\nvar _xit = jasmine.Env.prototype.xit;\njasmine.Env.prototype.it = function(desc, func) {\n // If spec is provided, only run matching specs\n if (!spec || desc.match(new RegExp(spec, 'i'))) {\n return _it.call(this, desc, func);\n } else {\n return this.xit(desc, func);\n }\n};\njasmine.Env.prototype.xit = function(desc, func) {\n if (typeof func == 'function') {\n var matches = func.toString().match(/.*\\W?expect\\(/g);\n if (matches) {\n this.reporter.subReporters_[0].skipCount += matches.length;\n this.reporter.subReporters_[0].totalCount += matches.length;\n }\n }\n return _xit.call(this, desc, func);\n}\n\n// Mainline Jasmine sets __Jasmine_been_here_before__ on each object to detect\n// cycles, but that doesn't work on frozen objects so we use a WeakMap instead.\n// We can only do this if if WeakMap is available, but if WeakMap is\n// unavailable, then objects probably can't be frozen anyway.\n\nif (typeof WeakMap !== \"undefined\") {\n var _comparedObjects = new WeakMap;\n\n jasmine.Env.prototype.compareObjects_ =\n function(a, b, mismatchKeys, mismatchValues) {\n if (_comparedObjects.get(a) === b && _comparedObjects.get(b) === a) {\n return true;\n }\n var areArrays = jasmine.isArray_(a) && jasmine.isArray_(b);\n\n _comparedObjects.set(a, b);\n _comparedObjects.set(b, a);\n\n var hasKey = function(obj, keyName) {\n return obj != null && obj[keyName] !== jasmine.undefined;\n };\n\n for (var property in b) {\n if (areArrays && typeof b[property] == 'function') {\n continue;\n }\n if (!hasKey(a, property) && hasKey(b, property)) {\n mismatchKeys.push(\n \"expected has key '\" + property + \"', but missing from actual.\"\n );\n }\n }\n for (property in a) {\n if (areArrays && typeof a[property] == 'function') {\n continue;\n }\n if (!hasKey(b, property) && hasKey(a, property)) {\n mismatchKeys.push(\n \"expected missing key '\" + property + \"', but present in actual.\"\n );\n }\n }\n for (property in b) {\n // The only different implementation from the original jasmine\n if (areArrays &&\n (typeof a[property] == 'function' ||\n typeof b[property] == 'function')) {\n continue;\n }\n if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues))\n {\n mismatchValues.push(\n \"'\" + property + \"' was '\" + (b[property] ?\n jasmine.util.htmlEscape(b[property].toString()) :\n b[property]) +\n \"' in expected, but was '\" + (a[property] ?\n jasmine.util.htmlEscape(a[property].toString()) :\n a[property]) + \"' in actual.\"\n );\n }\n }\n\n if (areArrays &&\n a.length != b.length) {\n mismatchValues.push(\"arrays were not the same length\");\n }\n\n _comparedObjects.delete(a);\n _comparedObjects.delete(b);\n return (mismatchKeys.length == 0 && mismatchValues.length == 0);\n };\n}\n",
"HtmlReporter":"var jasmine = require(\"./jasmine\");\n\nexports.HtmlReporter =\njasmine.HtmlReporter = function(_doc) {\n var self = this;\n var doc = _doc || window.document;\n\n var reporterView;\n\n var dom = {};\n\n // Jasmine Reporter Public Interface\n self.logRunningSpecs = false;\n\n self.reportRunnerStarting = function(runner) {\n var specs = runner.specs() || [];\n\n if (specs.length == 0) {\n return;\n }\n\n createReporterDom(runner.env.versionString());\n doc.body.appendChild(dom.reporter);\n setExceptionHandling();\n\n reporterView = new jasmine.HtmlReporter.ReporterView(dom);\n reporterView.addSpecs(specs, self.specFilter);\n };\n\n self.reportRunnerResults = function(runner) {\n reporterView && reporterView.complete();\n };\n\n self.reportSuiteResults = function(suite) {\n reporterView.suiteComplete(suite);\n };\n\n self.reportSpecStarting = function(spec) {\n if (self.logRunningSpecs) {\n self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');\n }\n };\n\n self.reportSpecResults = function(spec) {\n reporterView.specComplete(spec);\n };\n\n self.log = function() {\n var console = jasmine.getGlobal().console;\n if (console && console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n console.log(arguments); // ie fix: console.log.apply doesn't exist on ie\n }\n }\n };\n\n self.specFilter = function(spec) {\n if (!focusedSpecName()) {\n return true;\n }\n\n return spec.getFullName().indexOf(focusedSpecName()) === 0;\n };\n\n return self;\n\n function focusedSpecName() {\n var specName;\n\n (function memoizeFocusedSpec() {\n if (specName) {\n return;\n }\n\n var paramMap = [];\n var params = jasmine.HtmlReporter.parameters(doc);\n\n for (var i = 0; i < params.length; i++) {\n var p = params[i].split('=');\n paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);\n }\n\n specName = paramMap.spec;\n })();\n\n return specName;\n }\n\n function createReporterDom(version) {\n dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },\n dom.banner = self.createDom('div', { className: 'banner' },\n self.createDom('span', { className: 'title' }, \"Jasmine \"),\n self.createDom('span', { className: 'version' }, version)),\n\n dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),\n dom.alert = self.createDom('div', {className: 'alert'},\n self.createDom('span', { className: 'exceptions' },\n self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),\n self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),\n dom.results = self.createDom('div', {className: 'results'},\n dom.summary = self.createDom('div', { className: 'summary' }),\n dom.details = self.createDom('div', { id: 'details' }))\n );\n }\n\n function noTryCatch() {\n return window.location.search.match(/catch=false/);\n }\n\n function searchWithCatch() {\n var params = jasmine.HtmlReporter.parameters(window.document);\n var removed = false;\n var i = 0;\n\n while (!removed && i < params.length) {\n if (params[i].match(/catch=/)) {\n params.splice(i, 1);\n removed = true;\n }\n i++;\n }\n if (jasmine.CATCH_EXCEPTIONS) {\n params.push(\"catch=false\");\n }\n\n return params.join(\"&\");\n }\n\n function setExceptionHandling() {\n var chxCatch = document.getElementById('no_try_catch');\n\n if (noTryCatch()) {\n chxCatch.setAttribute('checked', true);\n jasmine.CATCH_EXCEPTIONS = false;\n }\n chxCatch.onclick = function() {\n window.location.search = searchWithCatch();\n };\n }\n};\njasmine.HtmlReporter.parameters = function(doc) {\n var paramStr = doc.location.search.substring(1);\n var params = [];\n\n if (paramStr.length > 0) {\n params = paramStr.split('&');\n }\n return params;\n}\njasmine.HtmlReporter.sectionLink = function(sectionName) {\n var link = '?';\n var params = [];\n\n if (sectionName) {\n params.push('spec=' + encodeURIComponent(sectionName));\n }\n if (!jasmine.CATCH_EXCEPTIONS) {\n params.push(\"catch=false\");\n }\n if (params.length > 0) {\n link += params.join(\"&\");\n }\n\n return link;\n};\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);\n",
"PrintReporter":"var jasmine = require(\"./jasmine\");\nvar diff = require('./diff');\n\nvar red = '\\u001b[1;41m';\nvar reset = '\\u001b[0m';\n\nfunction highlightDifferences(a, b) {\n var changes = diff.diffChars(a, b);\n\n var ret = {a: '', b: ''};\n var change;\n for (var i = 0, il = changes.length; i < il; i++) {\n change = changes[i];\n if (change.added) {\n ret.b += red + change.value + reset;\n } else if (change.removed) {\n ret.a += red + change.value + reset;\n } else {\n ret.a += change.value;\n ret.b += change.value;\n }\n }\n return ret;\n}\n\nfunction PrintReporter(name, root_directory) {\n this.skipCount = 0;\n this.failCount = 0;\n this.expectCount = 0;\n this.specCount = 0;\n this.name = name;\n this.rootDirectory = root_directory;\n}\nexports.PrintReporter =\njasmine.PrintReporter = PrintReporter;\n\nPrintReporter.prototype = new jasmine.Reporter();\n// Set verbose=true on the test instance to enable additional logging\nPrintReporter.prototype.verbose = false;\nPrintReporter.prototype._didSpecName = false;\n\nPrintReporter.prototype.reportSpecStarting = function(spec) {\n this._didSpecName = false;\n this._spec = spec;\n};\n\nPrintReporter.prototype.reportRunnerResults = function(runner) {\n // Don't print out the spec name at the end\n this._didSpecName = true;\n\n this.log([\n this.specCount + \" spec\",\n this.expectCount + \" expect\",\n this.skipCount + \" skip\",\n this.failCount + \" fail\"\n ].join(\" \"));\n\n require(\"./phantom\").exit(this.failCount);\n};\n\n\nPrintReporter.prototype.reportSuiteResults = function(suite) {\n var results = suite.results();\n if (this.verbose) {\n this.log('Suite \"' + suite.description + '\": ' +\n results.passedCount + '/' + results.totalCount + ' passed.');\n }\n\n // If suite is nested, only count the root suite\n if (!suite.parentSuite) {\n this.failCount += results.totalCount - results.passedCount;\n this.expectCount += results.totalCount;\n }\n};\n\nPrintReporter.prototype.reportSpecResults = function(spec) {\n if (this.verbose) {\n this.log('it... ' +\n spec.description + ': ' + (spec.results().passed() ? 'pass' : 'fail'));\n }\n\n var self = this;\n var results = spec.results();\n\n this.specCount += 1;\n\n if (results.skipped)\n this.skipCount += 1;\n\n results.getItems().forEach(function(result) {\n if (result.type == 'log') {\n self.log(result.toString());\n } else if (result.type == 'expect' && result.passed && !result.passed()) {\n var ppActual = jasmine.pp(result.actual);\n var ppExpected = jasmine.pp(result.expected);\n\n var colorDiff = highlightDifferences(ppActual, ppExpected);\n\n var message = result.message;\n message = message.replace(ppActual, colorDiff.a);\n message = message.replace(ppExpected, colorDiff.b);\n\n self.log(message);\n if (result.trace.stack) {\n self.log();\n result.trace.stack.split('\\n').forEach(function(stackFrame) {\n if (stackFrame.indexOf('/jasmine/lib/jasmine-core') > -1) {\n return;\n }\n if (this.rootDirectory) {\n stackFrame = stackFrame.replace(this.rootDirectory + '/', '');\n }\n self.log(' ' + stackFrame);\n }.bind(this));\n }\n }\n });\n};\n\nPrintReporter.prototype.log = function(str) {\n if (!this._didSpecName) {\n console.log('');\n console.log(\n this._spec.suite.description + ': it ' + this._spec.description);\n this._didSpecName = true;\n }\n console.log(str || '');\n};\n",
"ReporterView":"var jasmine = require(\"./jasmine\");\n\njasmine.HtmlReporter.ReporterView = function(dom) {\n this.startedAt = new Date();\n this.runningSpecCount = 0;\n this.completeSpecCount = 0;\n this.passedCount = 0;\n this.failedCount = 0;\n this.skippedCount = 0;\n\n this.createResultsMenu = function() {\n this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},\n this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: \"#\"}, '0 specs'),\n ' | ',\n this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: \"#\"}, '0 failing'));\n\n this.summaryMenuItem.onclick = function() {\n dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');\n };\n\n this.detailsMenuItem.onclick = function() {\n showDetails();\n };\n };\n\n this.addSpecs = function(specs, specFilter) {\n this.totalSpecCount = specs.length;\n\n this.views = {\n specs: {},\n suites: {}\n };\n\n for (var i = 0; i < specs.length; i++) {\n var spec = specs[i];\n this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);\n if (specFilter(spec)) {\n this.runningSpecCount++;\n }\n }\n };\n\n this.specComplete = function(spec) {\n this.completeSpecCount++;\n\n if (isUndefined(this.views.specs[spec.id])) {\n this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);\n }\n\n var specView = this.views.specs[spec.id];\n\n switch (specView.status()) {\n case 'passed':\n this.passedCount++;\n break;\n\n case 'failed':\n this.failedCount++;\n break;\n\n case 'skipped':\n this.skippedCount++;\n break;\n }\n\n specView.refresh();\n this.refresh();\n };\n\n this.suiteComplete = function(suite) {\n var suiteView = this.views.suites[suite.id];\n if (isUndefined(suiteView)) {\n return;\n }\n suiteView.refresh();\n };\n\n this.refresh = function() {\n\n if (isUndefined(this.resultsMenu)) {\n this.createResultsMenu();\n }\n\n // currently running UI\n if (isUndefined(this.runningAlert)) {\n this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: \"runningAlert bar\" });\n dom.alert.appendChild(this.runningAlert);\n }\n this.runningAlert.innerHTML = \"Running \" + this.completeSpecCount + \" of \" + specPluralizedFor(this.totalSpecCount);\n\n // skipped specs UI\n if (isUndefined(this.skippedAlert)) {\n this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: \"skippedAlert bar\" });\n }\n\n this.skippedAlert.innerHTML = \"Skipping \" + this.skippedCount + \" of \" + specPluralizedFor(this.totalSpecCount) + \" - run all\";\n\n if (this.skippedCount === 1 && isDefined(dom.alert)) {\n dom.alert.appendChild(this.skippedAlert);\n }\n\n // passing specs UI\n if (isUndefined(this.passedAlert)) {\n this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: \"passingAlert bar\" });\n }\n this.passedAlert.innerHTML = \"Passing \" + specPluralizedFor(this.passedCount);\n\n // failing specs UI\n if (isUndefined(this.failedAlert)) {\n this.failedAlert = this.createDom('span', {href: \"?\", className: \"failingAlert bar\"});\n }\n this.failedAlert.innerHTML = \"Failing \" + specPluralizedFor(this.failedCount);\n\n if (this.failedCount === 1 && isDefined(dom.alert)) {\n dom.alert.appendChild(this.failedAlert);\n dom.alert.appendChild(this.resultsMenu);\n }\n\n // summary info\n this.summaryMenuItem.innerHTML = \"\" + specPluralizedFor(this.runningSpecCount);\n this.detailsMenuItem.innerHTML = \"\" + this.failedCount + \" failing\";\n };\n\n this.complete = function() {\n dom.alert.removeChild(this.runningAlert);\n\n this.skippedAlert.innerHTML = \"Ran \" + this.runningSpecCount + \" of \" + specPluralizedFor(this.totalSpecCount) + \" - run all\";\n\n if (this.failedCount === 0) {\n dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, \"Passing \" + specPluralizedFor(this.passedCount)));\n } else {\n showDetails();\n }\n\n dom.banner.appendChild(this.createDom('span', {className: 'duration'}, \"finished in \" + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + \"s\"));\n };\n\n return this;\n\n function showDetails() {\n if (dom.reporter.className.search(/showDetails/) === -1) {\n dom.reporter.className += \" showDetails\";\n }\n }\n\n function isUndefined(obj) {\n return typeof obj === 'undefined';\n }\n\n function isDefined(obj) {\n return !isUndefined(obj);\n }\n\n function specPluralizedFor(count) {\n var str = count + \" spec\";\n if (count > 1) {\n str += \"s\"\n }\n return str;\n }\n\n};\n\njasmine.HtmlRLine truncated
"SpecView":"var jasmine = require(\"./jasmine\");\n\njasmine.HtmlReporter.SpecView = function(spec, dom, views) {\n this.spec = spec;\n this.dom = dom;\n this.views = views;\n\n this.symbol = this.createDom('li', { className: 'pending' });\n this.dom.symbolSummary.appendChild(this.symbol);\n\n this.summary = this.createDom('div', { className: 'specSummary' },\n this.createDom('a', {\n className: 'description',\n href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),\n title: this.spec.getFullName()\n }, this.spec.description)\n );\n\n this.detail = this.createDom('div', { className: 'specDetail' },\n this.createDom('a', {\n className: 'description',\n href: '?spec=' + encodeURIComponent(this.spec.getFullName()),\n title: this.spec.getFullName()\n }, this.spec.getFullName())\n );\n};\n\njasmine.HtmlReporter.SpecView.prototype.status = function() {\n return this.getSpecStatus(this.spec);\n};\n\njasmine.HtmlReporter.SpecView.prototype.refresh = function() {\n this.symbol.className = this.status();\n\n switch (this.status()) {\n case 'skipped':\n break;\n\n case 'passed':\n this.appendSummaryToSuiteDiv();\n break;\n\n case 'failed':\n this.appendSummaryToSuiteDiv();\n this.appendFailureDetail();\n break;\n }\n};\n\njasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {\n this.summary.className += ' ' + this.status();\n this.appendToSummary(this.spec, this.summary);\n};\n\njasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {\n this.detail.className += ' ' + this.status();\n\n var resultItems = this.spec.results().getItems();\n var messagesDiv = this.createDom('div', { className: 'messages' });\n\n for (var i = 0; i < resultItems.length; i++) {\n var result = resultItems[i];\n\n if (result.type == 'log') {\n messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));\n } else if (result.type == 'expect' && result.passed && !result.passed()) {\n messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));\n\n if (result.trace.stack) {\n messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));\n }\n }\n }\n\n if (messagesDiv.childNodes.length > 0) {\n this.detail.appendChild(messagesDiv);\n this.dom.details.appendChild(this.detail);\n }\n};\n\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);",
"SuiteView":"var jasmine = require(\"./jasmine\");\n\njasmine.HtmlReporter.SuiteView = function(suite, dom, views) {\n this.suite = suite;\n this.dom = dom;\n this.views = views;\n\n this.element = this.createDom('div', { className: 'suite' },\n this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)\n );\n\n this.appendToSummary(this.suite, this.element);\n};\n\njasmine.HtmlReporter.SuiteView.prototype.status = function() {\n return this.getSpecStatus(this.suite);\n};\n\njasmine.HtmlReporter.SuiteView.prototype.refresh = function() {\n this.element.className += \" \" + this.status();\n};\n\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);\n\n",
"diff":"/* See LICENSE file for terms of use */\n\n/*\n * Text diff implementation.\n * \n * This library supports the following APIS:\n * JsDiff.diffChars: Character by character diff\n * JsDiff.diffWords: Word (as defined by \\b regex) diff which ignores whitespace\n * JsDiff.diffLines: Line based diff\n * \n * JsDiff.diffCss: Diff targeted at CSS content\n * \n * These methods are based on the implementation proposed in\n * \"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986).\n * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927\n */\nvar JsDiff = (function() {\n function clonePath(path) {\n return { newPos: path.newPos, components: path.components.slice(0) };\n }\n function removeEmpty(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n }\n function escapeHTML(s) {\n var n = s;\n n = n.replace(/&/g, \"&amp;\");\n n = n.replace(/</g, \"&lt;\");\n n = n.replace(/>/g, \"&gt;\");\n n = n.replace(/\"/g, \"&quot;\");\n\n return n;\n }\n\n var fbDiff = function(ignoreWhitespace) {\n this.ignoreWhitespace = ignoreWhitespace;\n };\n fbDiff.prototype = {\n diff: function(oldString, newString) {\n // Handle the identity case (this is due to unrolling editLength == 0\n if (newString == oldString) {\n return [{ value: newString }];\n }\n if (!newString) {\n return [{ value: oldString, removed: true }];\n }\n if (!oldString) {\n return [{ value: newString, added: true }];\n }\n\n newString = this.tokenize(newString);\n oldString = this.tokenize(oldString);\n\n var newLen = newString.length, oldLen = oldString.length;\n var maxEditLength = newLen + oldLen;\n var bestPath = [{ newPos: -1, components: [] }];\n\n // Seed editLength = 0\n var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);\n if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return bestPath[0].components;\n }\n\n for (var editLength = 1; editLength <= maxEditLength; editLength++) {\n for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {\n var basePath;\n var addPath = bestPath[diagonalPath-1],\n removePath = bestPath[diagonalPath+1];\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath-1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos+1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n this.pushComponent(basePath.components, oldString[oldPos], undefined, true);\n } else {\n basePath = clonePath(addPath);\n basePath.newPos++;\n this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);\n }\n\n var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);\n\n if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return basePath.components;\n } else {\n bestPath[diagonalPath] = basePath;\n }\n }\n }\n },\n\n pushComponent: function(components, value, added, removed) {\n var last = components[components.length-1];\n if (last && last.added === added && last.removed === removed) {\n // We need to clone here as the component clone operation is just\n // as shallow array clone\n components[components.length-1] =\n {value: this.join(last.value, value), added: added, removed: removed };\n } else {\n components.push({value: value, added: added, removed: removed });\n }\n },\n extractCommon: function(basePath, newString, oldString, diagonalPath) {\n var newLen = newString.length,\n oldLen = oldString.length,\n newPos = basePath.newPos,\n oldPos = newPos - diagonalPath;\n while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) {\n newPos++;\n oldPos++;\n\n this.pushComponent(basePath.components, ne Line truncated
});
+266
View File
@@ -0,0 +1,266 @@
//# sourceURL=populist/loader.js
(function(entries, sources) {
var modules = {};
var hasOwn = modules.hasOwnProperty;
var global = Function("return this")();
var doc = global.document;
var head = doc.documentElement.firstChild;
function internalRequire(id) {
var module = getModule(id);
if (module && !hasOwn.call(module, "exports")) {
module(function(rid) {
return internalRequire(absolutize(id, rid));
}, module.exports = {}, module, global);
// If the module id has a non-null value in the entries object,
// define a global reference to its exports object.
var globalName = entries[id];
if (globalName && hasOwn.call(entries, id))
global[globalName] = module.exports;
}
return module.exports;
}
function getModule(id) {
if (!hasOwn.call(modules, id)) {
if (hasOwn.call(sources, id)) {
var name = "module$" + Math.random().toString(36).slice(2);
var script = doc.createElement("script");
var code = "function " + name + "(require,exports,module,global){" +
sources[id] + "\n}\n//# sourceURL=" + id + ".js\n";
script.setAttribute("type", "text/javascript");
script.setAttribute("encoding", "utf8");
script.appendChild(doc.createTextNode(code));
head.appendChild(script);
modules[id] = global[name];
} else {
throw new Error("Missing module: " + id);
}
}
return modules[id];
}
var pathNormExp = /\/(\.?|[^\/]+\/\.\.)\//;
function absolutize(id, rid) {
if (rid.charAt(0) === ".") {
rid = "/" + id + "/../" + rid;
while (rid != (id = rid.replace(pathNormExp, "/")))
rid = id;
rid = rid.replace(/^\//, "");
}
return rid;
}
// Eagerly require all identifiers that are keys of the entries object.
for (var id in entries)
if (hasOwn.call(entries, id))
internalRequire(id);
})({"test/all":"harness"},{
"test/all":"// This file exists both to give a single entry point for all the utility\n// modules in src/test and to specify an ordering on those modules, since\n// some still have implicit dependencies on others.\n\nrequire(\"./phantomjs-shims\");\nrequire(\"../ReactTestUtils\");\nrequire(\"../reactComponentExpect\");\nrequire(\"../mocks\");\nrequire(\"../mock-modules\");\nrequire(\"./mock-timers\");\n\nexports.enableTest = function(testID) {\n require(\"../\" + testID);\n};\n\nexports.removeNextSiblings = function(node) {\n var parent = node && node.parentNode;\n if (parent) {\n while (node.nextSibling) {\n parent.removeChild(node.nextSibling);\n }\n }\n};\n",
"addons/link/__tests__/LinkedStateMixin-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n/*jshint evil:true */\n\ndescribe('LinkedStateMixin', function() {\n var LinkedStateMixin;\n var React;\n var ReactLink;\n\n beforeEach(function() {\n LinkedStateMixin = require(\"../../../LinkedStateMixin\");\n React = require(\"../../../React\");\n ReactLink = require(\"../../../ReactLink\");\n });\n\n it('should create a ReactLink for state', function() {\n var Component = React.createClass({displayName: 'Component',\n mixins: [LinkedStateMixin],\n\n getInitialState: function() {\n return {value: 'initial value'};\n },\n\n render: function() {\n return React.DOM.span(null, \"value is \", this.state.value);\n }\n });\n var container = document.createElement('div');\n var component = React.renderComponent(Component(null ), container);\n var link = component.linkState('value');\n expect(component.state.value).toBe('initial value');\n expect(link.value).toBe('initial value');\n link.requestChange('new value');\n expect(component.state.value).toBe('new value');\n expect(component.linkState('value').value).toBe('new value');\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"addons/link/__tests__/LinkedStateMixin-test\", module);\n",
"addons/transitions/__tests__/ReactTransitionGroup-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTransitionGroup;\nvar mocks;\n\n// Most of the real functionality is covered in other unit tests, this just\n// makes sure we're wired up correctly.\ndescribe('ReactTransitionGroup', function() {\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactTransitionGroup = require(\"../../../ReactTransitionGroup\");\n mocks = require(\"../../../mocks\");\n });\n\n it('should warn after time with no transitionend', function() {\n var container;\n var a;\n\n container = document.createElement('div');\n a = React.renderComponent(\n ReactTransitionGroup( {transitionName:\"yolo\"}, \n React.DOM.span( {key:\"one\", id:\"one\"} )\n ),\n container\n );\n expect(a.getDOMNode().childNodes.length).toBe(1);\n\n setTimeout.mock.calls.length = 0;\n\n React.renderComponent(\n ReactTransitionGroup( {transitionName:\"yolo\"}, \n React.DOM.span( {key:\"two\", id:\"two\"} )\n ),\n container\n );\n expect(a.getDOMNode().childNodes.length).toBe(2);\n expect(a.getDOMNode().childNodes[0].id).toBe('two');\n expect(a.getDOMNode().childNodes[1].id).toBe('one');\n\n console.warn = mocks.getMockFunction();\n setTimeout.mock.calls[2][0]();\n\n expect(a.getDOMNode().childNodes.length).toBe(2);\n expect(console.warn.mock.calls.length).toBe(1);\n });\n\n it('should keep both sets of DOM nodes around', function() {\n var container = document.createElement('div');\n var a = React.renderComponent(\n ReactTransitionGroup( {transitionName:\"yolo\"}, \n React.DOM.span( {key:\"one\", id:\"one\"} )\n ),\n container\n );\n expect(a.getDOMNode().childNodes.length).toBe(1);\n React.renderComponent(\n ReactTransitionGroup( {transitionName:\"yolo\"}, \n React.DOM.span( {key:\"two\", id:\"two\"} )\n ),\n container\n );\n expect(a.getDOMNode().childNodes.length).toBe(2);\n expect(a.getDOMNode().childNodes[0].id).toBe('two');\n expect(a.getDOMNode().childNodes[1].id).toBe('one');\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"addons/transitions/__tests__/ReactTransitionGroup-test\", module);\n",
"addons/transitions/__tests__/ReactTransitionKeySet-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTransitionKeySet;\n\ndescribe('ReactTransitionKeySet', function() {\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactTransitionKeySet = require(\"../../../ReactTransitionKeySet\");\n });\n\n it('should support getChildMapping', function() {\n var oneone = React.DOM.div( {key:\"oneone\"} );\n var onetwo = React.DOM.div( {key:\"onetwo\"} );\n var one = React.DOM.div( {key:\"one\"}, oneone,onetwo);\n var two = React.DOM.div( {key:\"two\"} );\n var component = React.DOM.div(null, one,two);\n expect(ReactTransitionKeySet.getChildMapping(component.props.children))\n .toEqual({\n '{one}': one,\n '{two}': two\n });\n });\n\n it('should support getKeySet', function() {\n var oneone = React.DOM.div( {key:\"oneone\"} );\n var onetwo = React.DOM.div( {key:\"onetwo\"} );\n var one = React.DOM.div( {key:\"one\"}, oneone,onetwo);\n var two = React.DOM.div( {key:\"two\"} );\n var component = React.DOM.div(null, one,two);\n expect(ReactTransitionKeySet.getKeySet(component.props.children)).toEqual({\n '{one}': true,\n '{two}': true\n });\n });\n\n it('should support mergeKeySets for adding keys', function() {\n var prev = {\n one: true,\n two: true\n };\n var next = {\n one: true,\n two: true,\n three: true\n };\n expect(ReactTransitionKeySet.mergeKeySets(prev, next)).toEqual({\n one: true,\n two: true,\n three: true\n });\n });\n\n it('should support mergeKeySets for removing keys', function() {\n var prev = {\n one: true,\n two: true,\n three: true\n };\n var next = {\n one: true,\n two: true\n };\n expect(ReactTransitionKeySet.mergeKeySets(prev, next)).toEqual({\n one: true,\n two: true,\n three: true\n });\n });\n\n it('should support mergeKeySets for adding and removing', function() {\n var prev = {\n one: true,\n two: true,\n three: true\n };\n var next = {\n one: true,\n two: true,\n four: true\n };\n expect(ReactTransitionKeySet.mergeKeySets(prev, next)).toEqual({\n one: true,\n two: true,\n three: true,\n four: true\n });\n });\n\n it('should reconcile overlapping insertions and deletions', function() {\n var prev = {\n one: true,\n two: true,\n four: true,\n five: true\n };\n var next = {\n one: true,\n two: true,\n three: true,\n five: true\n };\n expect(ReactTransitionKeySet.mergeKeySets(prev, next)).toEqual({\n one: true,\n two: true,\n three: true,\n four: true,\n five: true\n });\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"addons/transitions/__tests__/ReactTransitionKeySet-test\", module);\n",
"addons/transitions/__tests__/ReactTransitionableChild-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTransitionableChild;\n\nvar mocks = require(\"../../../mocks\");\n\ndescribe('ReactTransitionableChild', function() {\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactTransitionableChild = require(\"../../../ReactTransitionableChild\");\n });\n\n it('should keep the DOM node around', function() {\n var container = document.createElement('div');\n var ac = React.renderComponent(\n ReactTransitionableChild(null, React.DOM.span( {id:\"test\"} )),\n container\n );\n expect(ac.getDOMNode().id).toBe('test');\n ac = React.renderComponent(ReactTransitionableChild(null ), container);\n expect(ac.getDOMNode().id).toBe('test');\n });\n\n it('should manage enter css classes correctly', function() {\n var runNextTick = mocks.getMockFunction();\n var container = document.createElement('div');\n var ac = React.renderComponent(\n ReactTransitionableChild(\n {runNextTick:runNextTick,\n name:\"myanim\",\n enter:true}, \n React.DOM.span( {id:\"test\"} )\n ),\n container\n );\n expect(ac.getDOMNode().id).toBe('test');\n expect(ac.getDOMNode().className.trim()).toBe('myanim-enter');\n expect(runNextTick.mock.calls.length).toBe(1);\n runNextTick.mock.calls[0][0]();\n expect(ac.getDOMNode().className.trim()).toBe(\n 'myanim-enter myanim-enter-active'\n );\n expect(runNextTick.mock.calls.length).toBe(1);\n });\n\n it('should manage leave css classes correctly', function() {\n var runNextTick = mocks.getMockFunction();\n var container = document.createElement('div');\n var ac = React.renderComponent(\n ReactTransitionableChild(\n {runNextTick:runNextTick,\n name:\"myanim\",\n enter:true,\n leave:true}, \n React.DOM.span( {id:\"test\"} )\n ),\n container\n );\n runNextTick.mock.calls[0][0]();\n expect(ac.getDOMNode().className.trim()).toBe(\n 'myanim-enter myanim-enter-active'\n );\n\n // TODO: we should just trigger the CSS animation end event to\n // clean these up\n ac.getDOMNode().className = '';\n React.renderComponent(\n ReactTransitionableChild(\n {runNextTick:runNextTick,\n name:\"myanim\",\n enter:true,\n leave:true}\n ),\n container\n );\n expect(ac.getDOMNode().className.trim()).toBe('myanim-leave');\n expect(runNextTick.mock.calls.length).toBe(2);\n runNextTick.mock.calls[1][0]();\n expect(ac.getDOMNode().className.trim()).toBe(\n 'myanim-leave myanim-leave-active'\n );\n expect(runNextTick.mock.calls.length).toBe(2);\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"addons/transitions/__tests__/ReactTransitionableChild-test\", module);\n",
"core/__tests__/ReactBind-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n/*global global:true*/\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\nvar React = require(\"../../React\");\nvar ReactDoNotBindDeprecated = require(\"../../ReactDoNotBindDeprecated\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\nvar reactComponentExpect = require(\"../../reactComponentExpect\");\n\n// TODO: Test render and all stock methods.\ndescribe('autobinding', function() {\n\n it('Holds reference to instance', function() {\n\n var mouseDidEnter = mocks.getMockFunction();\n var mouseDidLeave = mocks.getMockFunction();\n var mouseDidClick = mocks.getMockFunction();\n\n var TestBindComponent = React.createClass({displayName: 'TestBindComponent',\n getInitialState: function() {\n return {something: 'hi'};\n },\n onMouseEnter: ReactDoNotBindDeprecated.doNotBind(mouseDidEnter),\n onMouseLeave: ReactDoNotBindDeprecated.doNotBind(mouseDidLeave),\n onClick: mouseDidClick,\n\n // auto binding only occurs on top level functions in class defs.\n badIdeas: {\n badBind: function() {\n this.state.something;\n }\n },\n\n render: function() {\n return (\n React.DOM.div(\n {onMouseEnter:this.onMouseEnter.bind(this),\n onMouseLeave:this.onMouseLeave,\n onClick:this.onClick}\n )\n );\n }\n });\n\n var instance1 = TestBindComponent(null );\n ReactTestUtils.renderIntoDocument(instance1);\n var rendered1 = reactComponentExpect(instance1)\n .expectRenderedChild()\n .instance();\n\n var instance2 = TestBindComponent(null );\n ReactTestUtils.renderIntoDocument(instance2);\n var rendered2 = reactComponentExpect(instance2)\n .expectRenderedChild()\n .instance();\n\n expect(function() {\n var badIdea = instance1.badIdeas.badBind;\n badIdea();\n }).toThrow();\n\n expect(instance1.onMouseEnter).toBe(instance2.onMouseEnter);\n expect(instance1.onMouseLeave).toBe(instance2.onMouseLeave);\n expect(instance1.onClick).not.toBe(instance2.onClick);\n\n ReactTestUtils.Simulate.click(rendered1);\n expect(mouseDidClick.mock.instances.length).toBe(1);\n expect(mouseDidClick.mock.instances[0]).toBe(instance1);\n\n ReactTestUtils.Simulate.click(rendered2);\n expect(mouseDidClick.mock.instances.length).toBe(2);\n expect(mouseDidClick.mock.instances[1]).toBe(instance2);\n\n ReactTestUtils.Simulate.mouseOver(rendered1);\n expect(mouseDidEnter.mock.instances.length).toBe(1);\n expect(mouseDidEnter.mock.instances[0]).toBe(instance1);\n\n ReactTestUtils.Simulate.mouseOver(rendered2);\n expect(mouseDidEnter.mock.instances.length).toBe(2);\n expect(mouseDidEnter.mock.instances[1]).toBe(instance2);\n\n ReactTestUtils.Simulate.mouseOut(rendered1);\n expect(mouseDidLeave.mock.instances.length).toBe(1);\n expect(mouseDidLeave.mock.instances[0]).toBe(global);\n\n ReactTestUtils.Simulate.mouseOut(rendered2);\n expect(mouseDidLeave.mock.instances.length).toBe(2);\n expect(mouseDidLeave.mock.instances[1]).toBe(global);\n });\n\n it('works with mixins', function() {\n var mouseDidClick = mocks.getMockFunction();\n\n var TestMixin = {\n onClick: mouseDidClick\n };\n\n var TestBindComponent = React.createClass({displayName: 'TestBindComponent',\n mixins: [TestMixin],\n\n render: function() {\n return React.DOM.div( {onClick:this.onClick} );\n }\n });\n\n var instance1 = TestBindComponent(null );\n ReactTestUtils.renderIntoDocument(instance1);\n var rendered1 = reactComponentExpect(instance1)\n .expectRenderedChild()\n .instance();\n\n ReactTestUtils.Simulate.click(rendered1);\n expect(mouseDidClick.mock.instances.length).toBe(1);\n expect(mouseDidClick.mock.instances[0]).toBe(instance1);\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactBind-test\", module);\n",
"core/__tests__/ReactComponent-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTestUtils;\n\nvar reactComponentExpect;\n\ndescribe('ReactComponent', function() {\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n });\n\n it('should throw on invalid render targets', function() {\n var container = document.createElement('div');\n // jQuery objects are basically arrays; people often pass them in by mistake\n expect(function() {\n React.renderComponent(React.DOM.div(null), [container]);\n }).toThrow(\n 'Invariant Violation: prepareEnvironmentForDOM(...): Target container ' +\n 'is not a DOM element.'\n );\n\n expect(function() {\n React.renderComponent(React.DOM.div(null), null);\n }).toThrow(\n 'Invariant Violation: prepareEnvironmentForDOM(...): Target container ' +\n 'is not a DOM element.'\n );\n });\n\n it('should throw when supplying a ref outside of render method', function() {\n var instance = React.DOM.div( {ref:\"badDiv\"} );\n expect(function() {\n ReactTestUtils.renderIntoDocument(instance);\n }).toThrow();\n });\n\n it('should throw when attempting to hijack a ref', function() {\n var Component = React.createClass({displayName: 'Component',\n render: function() {\n var child = this.props.child;\n this.attachRef('test', child);\n return child;\n }\n });\n\n var instance = Component( {child:React.DOM.span(null )} );\n\n expect(function() {\n ReactTestUtils.renderIntoDocument(instance);\n }).toThrow(\n 'Invariant Violation: attachRef(test, ...): Only a component\\'s owner ' +\n 'can store a ref to it.'\n );\n });\n\n it('should support refs on owned components', function() {\n var inner, outer;\n\n var Component = React.createClass({displayName: 'Component',\n render: function() {\n inner = React.DOM.div( {ref:\"inner\"} );\n outer = React.DOM.div( {ref:\"outer\"}, inner);\n return outer;\n },\n componentDidMount: function() {\n expect(this.refs.inner).toEqual(inner);\n expect(this.refs.outer).toEqual(outer);\n }\n });\n\n var instance = Component( {child:React.DOM.span(null )} );\n ReactTestUtils.renderIntoDocument(instance);\n });\n\n it('should not have refs on unmounted components', function() {\n var Parent = React.createClass({displayName: 'Parent',\n render: function() {\n return Child(null, React.DOM.div( {ref:\"test\"} ));\n },\n componentDidMount: function() {\n expect(this.refs && this.refs.test).toEqual(undefined);\n }\n });\n var Child = React.createClass({displayName: 'Child',\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n var instance = Parent( {child:React.DOM.span(null )} );\n ReactTestUtils.renderIntoDocument(instance);\n });\n\n it('should correctly determine if a component is mounted', function() {\n var Component = React.createClass({displayName: 'Component',\n componentWillMount: function() {\n expect(this.isMounted()).toBeFalsy();\n },\n componentDidMount: function() {\n expect(this.isMounted()).toBeTruthy();\n },\n render: function() {\n return React.DOM.div(null);\n }\n });\n\n var instance = Component(null );\n\n expect(instance.isMounted()).toBeFalsy();\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.isMounted()).toBeTruthy();\n });\n\n it('should know its simple mount depth', function() {\n var Owner = React.createClass({displayName: 'Owner',\n render: function() {\n return Child( {ref:\"child\"} );\n }\n });\n\n var Child = React.createClass({displayName: 'Child',\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n var instance = Owner(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance._mountDepth).toBe(0);\n expect(instance.refs.child._mountDepth).toBe(1);\n });\n\n it('should know its (complicated) mount depth', function() {\n var Box = React.createClass({displayName: 'Box',\n render: functionLine truncated
"core/__tests__/ReactComponentLifeCycle-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTestUtils;\nvar ReactComponent;\nvar ReactCompositeComponent;\nvar ComponentLifeCycle;\nvar CompositeComponentLifeCycle;\n\nvar clone = function(o) {\n return JSON.parse(JSON.stringify(o));\n};\n\n\nvar GET_INIT_STATE_RETURN_VAL = {\n hasWillMountCompleted: false,\n hasRenderCompleted: false,\n hasDidMountCompleted: false,\n hasWillUnmountCompleted: false\n};\n\nvar INIT_RENDER_STATE = {\n hasWillMountCompleted: true,\n hasRenderCompleted: false,\n hasDidMountCompleted: false,\n hasWillUnmountCompleted: false\n};\n\nvar DID_MOUNT_STATE = {\n hasWillMountCompleted: true,\n hasRenderCompleted: true,\n hasDidMountCompleted: false,\n hasWillUnmountCompleted: false\n};\n\nvar NEXT_RENDER_STATE = {\n hasWillMountCompleted: true,\n hasRenderCompleted: true,\n hasDidMountCompleted: true,\n hasWillUnmountCompleted: false\n};\n\nvar WILL_UNMOUNT_STATE = {\n hasWillMountCompleted: true,\n hasDidMountCompleted: true,\n hasRenderCompleted: true,\n hasWillUnmountCompleted: false\n};\n\nvar POST_WILL_UNMOUNT_STATE = {\n hasWillMountCompleted: true,\n hasDidMountCompleted: true,\n hasRenderCompleted: true,\n hasWillUnmountCompleted: true\n};\n\n/**\n * TODO: We should make any setState calls fail in\n * `getInitialState` and `componentWillMount`. They will usually fail\n * anyways because `this._renderedComponent` is empty, however, if a component\n * is *reused*, then that won't be the case and things will appear to work in\n * some cases. Better to just block all updates in initialization.\n */\ndescribe('ReactComponentLifeCycle', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n ReactComponent = require(\"../../ReactComponent\");\n ReactCompositeComponent = require(\"../../ReactCompositeComponent\");\n ComponentLifeCycle = ReactComponent.LifeCycle;\n CompositeComponentLifeCycle = ReactCompositeComponent.LifeCycle;\n });\n\n it('should scrub state when reinitialized using getInitialState', function() {\n var StatefulComponent = React.createClass({displayName: 'StatefulComponent',\n getInitialState: function() {\n return { };\n },\n addAnotherField: function() {\n this.setState({\n aField: 'asdf'\n });\n },\n render: function() {\n return (\n React.DOM.div(null )\n );\n }\n });\n var instance = StatefulComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n instance.addAnotherField();\n expect(instance.state.aField).toBe('asdf');\n instance.unmountComponent();\n ReactTestUtils.renderIntoDocument(instance);\n expect(typeof instance.state.aField).toBe('undefined');\n });\n\n /**\n * If a state update triggers rerendering that in turn fires an onDOMReady,\n * that second onDOMReady should not fail.\n */\n it('it should fire onDOMReady when already in onDOMReady', function() {\n\n var _testJournal = [];\n\n var Child = React.createClass({displayName: 'Child',\n componentDidMount: function() {\n _testJournal.push('Child:onDOMReady');\n },\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n var SwitcherParent = React.createClass({displayName: 'SwitcherParent',\n getInitialState: function() {\n _testJournal.push('SwitcherParent:getInitialState');\n return {showHasOnDOMReadyComponent: false};\n },\n componentDidMount: function() {\n _testJournal.push('SwitcherParent:onDOMReady');\n this.switchIt();\n },\n switchIt: function() {\n this.setState({showHasOnDOMReadyComponent: true});\n },\n render: function() {\n return (\n React.DOM.div(null, \n this.state.showHasOnDOMReadyComponent ?\n Child(null ) :\n React.DOM.div(null )\n )\n );\n }\n });\n\n var instance = SwitcherParent(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(_testJournal).toEqual([\n 'SwitcherParent:getInitialState',\n 'SwitcherParent:onDOMReady',\n 'Child:onDOMReady'\n ]);\n });\n\n\n Line truncated
"core/__tests__/ReactCompositeComponent-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar MorphingComponent;\nvar ChildUpdates;\nvar React;\nvar ReactCurrentOwner;\nvar ReactPropTypes;\nvar ReactTestUtils;\nvar ReactMount;\nvar ReactDoNotBindDeprecated;\n\nvar cx;\nvar reactComponentExpect;\nvar mocks;\n\ndescribe('ReactCompositeComponent', function() {\n\n beforeEach(function() {\n cx = require(\"../../cx\");\n mocks = require(\"../../mocks\");\n\n reactComponentExpect = require(\"../../reactComponentExpect\");\n React = require(\"../../React\");\n ReactCurrentOwner = require(\"../../ReactCurrentOwner\");\n ReactDoNotBindDeprecated = require(\"../../ReactDoNotBindDeprecated\");\n ReactPropTypes = require(\"../../ReactPropTypes\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n ReactMount = require(\"../../ReactMount\");\n\n MorphingComponent = React.createClass({\n getInitialState: function() {\n return {activated: false};\n },\n\n _toggleActivatedState: function() {\n this.setState({activated: !this.state.activated});\n },\n\n render: function() {\n var toggleActivatedState = this._toggleActivatedState;\n return !this.state.activated ?\n React.DOM.a( {ref:\"x\", onClick:toggleActivatedState} ) :\n React.DOM.b( {ref:\"x\", onClick:toggleActivatedState} );\n }\n });\n\n /**\n * We'll use this to ensure that an old version is not cached when it is\n * reallocated again.\n */\n ChildUpdates = React.createClass({\n getAnchorID: function() {\n return this.refs.anch._rootNodeID;\n },\n render: function() {\n var className = cx({'anchorClass': this.props.anchorClassOn});\n return this.props.renderAnchor ?\n React.DOM.a( {ref:\"anch\", className:className}) :\n React.DOM.b(null);\n }\n });\n });\n\n it('should support rendering to different child types over time', function() {\n var instance = MorphingComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('a');\n\n instance._toggleActivatedState();\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('b');\n\n instance._toggleActivatedState();\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('a');\n });\n\n it('should react to state changes from callbacks', function() {\n var instance = MorphingComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n\n var renderedChild = reactComponentExpect(instance)\n .expectRenderedChild()\n .instance();\n\n ReactTestUtils.Simulate.click(renderedChild);\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('b');\n });\n\n it('should rewire refs when rendering to different child types', function() {\n var instance = MorphingComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n\n reactComponentExpect(instance.refs.x).toBeDOMComponentWithTag('a');\n instance._toggleActivatedState();\n reactComponentExpect(instance.refs.x).toBeDOMComponentWithTag('b');\n instance._toggleActivatedState();\n reactComponentExpect(instance.refs.x).toBeDOMComponentWithTag('a');\n });\n\n it('should not cache old DOM nodes when switching constructors', function() {\n var instance = ChildUpdates( {renderAnchor:true, anchorClassOn:false});\n ReactTestUtils.renderIntoDocument(instance);\n instance.setProps({anchorClassOn: true}); // Warm any cache\n instance.setProps({renderAnchor: false}); // Clear out the anchor\n // rerender\n instance.setProps({renderAnchor: true, anchorClassOn: false});\n var anchorID = instance.getAnchorID();\n var actualDOMAnchorNode = ReactMount.getNode(anchorID);\n expect(actualDOMAnchorNode.className).toBe('');\n });\n\n it('should auto bind methods and values correctly', function() {\n spyOn(console, 'warn');\n\n var ComponentClass = React.createClass({displayName: 'ComponentClass',\n getInitialState: function() {\n return {valueToReturn: 'hi'};\n },\n methodToBeExplicitlyBound: function() {\n return this;\n Line truncated
"core/__tests__/ReactCompositeComponentDOMMinimalism-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n// Requires\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\n\n// Test components\nvar LowerLevelComposite;\nvar MyCompositeComponent;\n\nvar expectSingleChildlessDiv;\n\n/**\n * Integration test, testing the combination of JSX with our unit of\n * abstraction, `ReactCompositeComponent` does not ever add superfluous DOM\n * nodes.\n */\ndescribe('ReactCompositeComponentDOMMinimalism', function() {\n\n beforeEach(function() {\n reactComponentExpect = require(\"../../reactComponentExpect\");\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n\n LowerLevelComposite = React.createClass({\n render: function() {\n return (\n React.DOM.div(null, \n this.props.children\n )\n );\n }\n });\n\n MyCompositeComponent = React.createClass({\n render: function() {\n return (\n LowerLevelComposite(null, \n this.props.children\n )\n );\n }\n });\n\n expectSingleChildlessDiv = function(instance) {\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeCompositeComponentWithType(LowerLevelComposite)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('div')\n .toBeDOMComponentWithNoChildren();\n };\n });\n\n it('should not render extra nodes for non-interpolated text', function() {\n var instance = (\n MyCompositeComponent(null, \n \" A string child \"\n )\n );\n ReactTestUtils.renderIntoDocument(instance);\n expectSingleChildlessDiv(instance);\n });\n\n it('should not render extra nodes for non-interpolated text', function() {\n var instance = (\n MyCompositeComponent(null, \n 'Interpolated String Child'\n )\n );\n ReactTestUtils.renderIntoDocument(instance);\n expectSingleChildlessDiv(instance);\n });\n\n it('should not render extra nodes for non-interpolated text', function() {\n var instance = (\n MyCompositeComponent(null, \n React.DOM.ul(null, \n \" This text causes no children in ul, just innerHTML \"\n )\n )\n );\n ReactTestUtils.renderIntoDocument(instance);\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeCompositeComponentWithType(LowerLevelComposite)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('div')\n .toBeDOMComponentWithChildCount(1)\n .expectRenderedChildAt(0)\n .toBeDOMComponentWithTag('ul')\n .toBeDOMComponentWithNoChildren();\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactCompositeComponentDOMMinimalism-test\", module);\n",
"core/__tests__/ReactCompositeComponentMixin-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\n\nvar TestComponent;\nvar TestComponentWithPropTypes;\nvar mixinPropValidator;\nvar componentPropValidator;\n\ndescribe('ReactCompositeComponent-mixin', function() {\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n mixinPropValidator = mocks.getMockFunction();\n componentPropValidator = mocks.getMockFunction();\n\n var MixinA = {\n componentDidMount: function() {\n this.props.listener('MixinA didMount');\n }\n };\n\n var MixinB = {\n mixins: [MixinA],\n componentDidMount: function() {\n this.props.listener('MixinB didMount');\n }\n };\n\n var MixinC = {\n componentDidMount: function() {\n this.props.listener('MixinC didMount');\n }\n };\n\n var MixinD = {\n propTypes: {\n value: mixinPropValidator\n }\n };\n\n TestComponent = React.createClass({\n mixins: [MixinB, MixinC, MixinD],\n\n componentDidMount: function() {\n this.props.listener('Component didMount');\n },\n\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n TestComponentWithPropTypes = React.createClass({\n mixins: [MixinD],\n propTypes: {\n value: componentPropValidator\n },\n render: function() {\n return React.DOM.div(null );\n }\n });\n });\n\n it('should support chaining delegate functions', function() {\n var listener = mocks.getMockFunction();\n var instance = TestComponent( {listener:listener} );\n ReactTestUtils.renderIntoDocument(instance);\n\n expect(listener.mock.calls).toEqual([\n ['MixinA didMount'],\n ['MixinB didMount'],\n ['MixinC didMount'],\n ['Component didMount']\n ]);\n });\n\n it('should validate prop types via mixins', function() {\n expect(TestComponent.componentConstructor.propTypes).toBeDefined();\n expect(TestComponent.componentConstructor.propTypes.value)\n .toBe(mixinPropValidator);\n });\n\n it('should override mixin prop types with class prop types', function() {\n // Sanity check...\n expect(componentPropValidator).toNotBe(mixinPropValidator);\n // Actually check...\n expect(TestComponentWithPropTypes.componentConstructor.propTypes)\n .toBeDefined();\n expect(TestComponentWithPropTypes.componentConstructor.propTypes.value)\n .toNotBe(mixinPropValidator);\n expect(TestComponentWithPropTypes.componentConstructor.propTypes.value)\n .toBe(componentPropValidator);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactCompositeComponentMixin-test\", module);\n",
"core/__tests__/ReactCompositeComponentSpec-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\n\ndescribe('ReactCompositeComponent-spec', function() {\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n });\n\n it('should throw when `render` is not specified', function() {\n expect(function() {\n React.createClass({});\n }).toThrow(\n 'Invariant Violation: createClass(...): Class specification must ' +\n 'implement a `render` method.'\n );\n });\n\n it('should copy `displayName` onto the Constructor', function() {\n var TestComponent = React.createClass({displayName: 'TestComponent',\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n expect(TestComponent.componentConstructor.displayName)\n .toBe('TestComponent');\n });\n\n it('should copy prop types onto the Constructor', function() {\n var propValidator = mocks.getMockFunction();\n var TestComponent = React.createClass({displayName: 'TestComponent',\n propTypes: {\n value: propValidator\n },\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n expect(TestComponent.componentConstructor.propTypes).toBeDefined();\n expect(TestComponent.componentConstructor.propTypes.value)\n .toBe(propValidator);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactCompositeComponentSpec-test\", module);\n",
"core/__tests__/ReactCompositeComponentState-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\n\nvar TestComponent;\n\ndescribe('ReactCompositeComponent-state', function() {\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n\n TestComponent = React.createClass({\n peekAtState: function(from, state) {\n if (state) {\n this.props.stateListener(from, state && state.color);\n } else {\n this.props.stateListener(\n from,\n this.state && this.state.color,\n this._pendingState && this._pendingState.color\n );\n }\n },\n\n setFavoriteColor: function(nextColor) {\n this.setState({color: nextColor});\n },\n\n getInitialState: function() {\n this.peekAtState('getInitialState');\n return {color: 'red'};\n },\n\n render: function() {\n this.peekAtState('render');\n return React.DOM.div(null, this.state.color);\n },\n\n componentWillMount: function() {\n this.peekAtState('componentWillMount-start');\n this.setState({color: 'sunrise'});\n this.peekAtState('componentWillMount-after-sunrise');\n this.setState({color: 'orange'});\n this.peekAtState('componentWillMount-end');\n },\n\n componentDidMount: function() {\n this.peekAtState('componentDidMount-start');\n this.setState({color: 'yellow'});\n this.peekAtState('componentDidMount-end');\n },\n\n componentWillReceiveProps: function(newProps) {\n this.peekAtState('componentWillReceiveProps-start');\n if (newProps.nextColor) {\n this.setState({color: newProps.nextColor});\n }\n this.peekAtState('componentWillReceiveProps-end');\n },\n\n shouldComponentUpdate: function(nextProps, nextState) {\n this.peekAtState('shouldComponentUpdate-currentState');\n this.peekAtState('shouldComponentUpdate-nextState', nextState);\n return true;\n },\n\n componentWillUpdate: function(nextProps, nextState) {\n this.peekAtState('componentWillUpdate-currentState');\n this.peekAtState('componentWillUpdate-nextState', nextState);\n },\n\n componentDidUpdate: function(prevProps, prevState) {\n this.peekAtState('componentDidUpdate-currentState');\n this.peekAtState('componentDidUpdate-prevState', prevState);\n },\n\n componentWillUnmount: function() {\n this.peekAtState('componentWillUnmount');\n }\n });\n\n });\n\n it('should support setting state', function() {\n var stateListener = mocks.getMockFunction();\n var instance = TestComponent( {stateListener:stateListener} );\n ReactTestUtils.renderIntoDocument(instance);\n instance.setProps({nextColor: 'green'});\n instance.setFavoriteColor('blue');\n instance.forceUpdate();\n instance.unmountComponent();\n\n expect(stateListener.mock.calls).toEqual([\n // there is no state when getInitialState() is called\n [ 'getInitialState', null, null ],\n [ 'componentWillMount-start', 'red', null ],\n // setState() only enqueues a pending state.\n [ 'componentWillMount-after-sunrise', 'red', 'sunrise' ],\n [ 'componentWillMount-end', 'red', 'orange' ],\n // pending state has been applied\n [ 'render', 'orange', null ],\n [ 'componentDidMount-start', 'orange', null ],\n // componentDidMount() called setState({color:'yellow'}), currently this\n // occurs inline.\n // In a future where setState() is async, this test result will change.\n [ 'shouldComponentUpdate-currentState', 'orange', null ],\n [ 'shouldComponentUpdate-nextState', 'yellow' ],\n [ 'componentWillUpdate-currentState', 'orange', null ],\n [ 'componentWillUpdate-nextState', 'yellow' ],\n [ 'render', 'yellow', null ],\n [ 'componentDidUpdate-currentState', 'yellow', null ],\n [ 'componentDidUpdate-prevState', 'orange' ],\n // componentDidMount() finally closes.\n [ 'componentDidMount-end', 'yellow', null ],\n [ 'componentWillR Line truncated
"core/__tests__/ReactDOM-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\nvar ReactDOM = require(\"../../ReactDOM\");\nvar ReactMount = require(\"../../ReactMount\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\n\ndescribe('ReactDOM', function() {\n // TODO: uncomment this test once we can run in phantom, which\n // supports real submit events.\n /*\n it('should bubble onSubmit', function() {\n var count = 0;\n var form;\n var Parent = React.createClass({\n handleSubmit: function() {\n count++;\n return false;\n },\n render: function() {\n return <Child />;\n }\n });\n var Child = React.createClass({\n render: function() {\n return <form><input type=\"submit\" value=\"Submit\" /></form>;\n },\n componentDidMount: function(node) {\n form = node;\n }\n });\n var instance = ReactTestUtils.renderIntoDocument(<Parent />);\n form.submit();\n expect(count).toEqual(1);\n });\n */\n\n it(\"should allow children to be passed as an argument\", function() {\n var argDiv = ReactTestUtils.renderIntoDocument(\n ReactDOM.div(null, 'child')\n );\n var argNode = ReactMount.getNode(argDiv._rootNodeID);\n expect(argNode.innerHTML).toBe('child');\n });\n\n it(\"should overwrite props.children with children argument\", function() {\n var conflictDiv = ReactTestUtils.renderIntoDocument(\n ReactDOM.div({children: 'fakechild'}, 'child')\n );\n var conflictNode = ReactMount.getNode(conflictDiv._rootNodeID);\n expect(conflictNode.innerHTML).toBe('child');\n });\n\n /**\n * We need to make sure that updates occur to the actual node that's in the\n * DOM, instead of a stale cache.\n */\n it(\"should purge the DOM cache when removing nodes\", function() {\n var myDiv = ReactTestUtils.renderIntoDocument(\n React.DOM.div(null, {\n theDog: React.DOM.div( {className:\"dog\"} ),\n theBird: React.DOM.div( {className:\"bird\"} )\n })\n );\n // Warm the cache with theDog\n myDiv.setProps({\n children: {\n theDog: React.DOM.div( {className:\"dogbeforedelete\"} ),\n theBird: React.DOM.div( {className:\"bird\"} )\n }\n });\n // Remove theDog - this should purge the cache\n myDiv.setProps({\n children: {\n theBird: React.DOM.div( {className:\"bird\"} )\n }\n });\n // Now, put theDog back. It's now a different DOM node.\n myDiv.setProps({\n children: {\n theDog: React.DOM.div( {className:\"dog\"} ),\n theBird: React.DOM.div( {className:\"bird\"} )\n }\n });\n // Change the className of theDog. It will use the same element\n myDiv.setProps({\n children: {\n theDog: React.DOM.div( {className:\"bigdog\"} ),\n theBird: React.DOM.div( {className:\"bird\"} )\n }\n });\n var root = ReactMount.getNode(myDiv._rootNodeID);\n var dog = root.childNodes[0];\n expect(dog.className).toBe('bigdog');\n });\n\n it('should be a valid class', function() {\n expect(React.isValidClass(ReactDOM.div)).toBe(true);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactDOM-test\", module);\n",
"core/__tests__/ReactDOMComponent-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\ndescribe('ReactDOMComponent', function() {\n\n describe('updateDOM', function() {\n var React;\n var ReactTestUtils;\n var transaction;\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n\n var ReactReconcileTransaction = require(\"../../ReactReconcileTransaction\");\n transaction = new ReactReconcileTransaction();\n });\n\n it(\"should handle className\", function() {\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.div( {style:{}} ));\n\n stub.receiveProps({ className: 'foo' }, transaction);\n expect(stub.getDOMNode().className).toEqual('foo');\n stub.receiveProps({ className: 'bar' }, transaction);\n expect(stub.getDOMNode().className).toEqual('bar');\n stub.receiveProps({ className: null }, transaction);\n expect(stub.getDOMNode().className).toEqual('');\n });\n\n it(\"should gracefully handle various style value types\", function() {\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.div( {style:{}} ));\n var stubStyle = stub.getDOMNode().style;\n\n // set initial style\n var setup = { display: 'block', left: '1', top: 2, fontFamily: 'Arial' };\n stub.receiveProps({ style: setup }, transaction);\n expect(stubStyle.display).toEqual('block');\n expect(stubStyle.left).toEqual('1px');\n expect(stubStyle.fontFamily).toEqual('Arial');\n\n // reset the style to their default state\n var reset = { display: '', left: null, top: false, fontFamily: true };\n stub.receiveProps({ style: reset }, transaction);\n expect(stubStyle.display).toEqual('');\n expect(stubStyle.left).toEqual('');\n expect(stubStyle.top).toEqual('');\n expect(stubStyle.fontFamily).toEqual('');\n });\n\n it(\"should update styles when mutating style object\", function() {\n var styles = { display: 'none', fontFamily: 'Arial', opacity: 0 };\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.div( {style:styles} ));\n\n var stubStyle = stub.getDOMNode().style;\n stubStyle.display = styles.display;\n stubStyle.fontFamily = styles.fontFamily;\n\n styles.display = 'block';\n\n stub.receiveProps({ style: styles }, transaction);\n expect(stubStyle.display).toEqual('block');\n expect(stubStyle.fontFamily).toEqual('Arial');\n expect(stubStyle.opacity).toEqual('0');\n\n styles.fontFamily = 'Helvetica';\n\n stub.receiveProps({ style: styles }, transaction);\n expect(stubStyle.display).toEqual('block');\n expect(stubStyle.fontFamily).toEqual('Helvetica');\n expect(stubStyle.opacity).toEqual('0');\n\n styles.opacity = 0.5;\n\n stub.receiveProps({ style: styles }, transaction);\n expect(stubStyle.display).toEqual('block');\n expect(stubStyle.fontFamily).toEqual('Helvetica');\n expect(stubStyle.opacity).toEqual('0.5');\n });\n\n it(\"should update styles if initially null\", function() {\n var styles = null;\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.div( {style:styles} ));\n\n var stubStyle = stub.getDOMNode().style;\n\n styles = {display: 'block'};\n\n stub.receiveProps({ style: styles }, transaction);\n expect(stubStyle.display).toEqual('block');\n });\n\n it(\"should remove attributes\", function() {\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.img( {height:\"17\"} ));\n\n expect(stub.getDOMNode().hasAttribute('height')).toBe(true);\n stub.receiveProps({}, transaction);\n expect(stub.getDOMNode().hasAttribute('height')).toBe(false);\n });\n\n it(\"should remove properties\", function() {\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.div( {className:\"monkey\"} ));\n\n expect(stub.getDOMNode().className).toEqual('monkey');\n stub.receiveProps({}, transaction);\n expect(stub.getDOMNode().className).toEqual('');\n });\n\n it(\"should clear a single style prop when changing 'style'\", function() {\n var styles = {display: 'none', color: 'red'};\n var stub = ReactTestUtils.renderIntoDocument(React.DOM.divLine truncated
"core/__tests__/ReactDOMIDOperations-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\ndescribe('ReactDOMIDOperations', function() {\n var DOMPropertyOperations = require(\"../../DOMPropertyOperations\");\n var ReactDOMIDOperations = require(\"../../ReactDOMIDOperations\");\n var ReactMount = require(\"../../ReactMount\");\n var keyOf = require(\"../../keyOf\");\n\n it('should disallow updating special properties', function() {\n spyOn(ReactMount, \"getNode\");\n spyOn(DOMPropertyOperations, \"setValueForProperty\");\n\n expect(function() {\n ReactDOMIDOperations.updatePropertyByID(\n 'testID',\n keyOf({dangerouslySetInnerHTML: null}),\n {__html: 'testContent'}\n );\n }).toThrow();\n\n expect(\n ReactMount.getNode.argsForCall[0][0]\n ).toBe('testID');\n\n expect(\n DOMPropertyOperations.setValueForProperty.callCount\n ).toBe(0);\n });\n\n it('should update innerHTML and special-case whitespace', function() {\n var stubNode = document.createElement('div');\n spyOn(ReactMount, \"getNode\").andReturn(stubNode);\n\n ReactDOMIDOperations.updateInnerHTMLByID(\n 'testID',\n ' testContent'\n );\n\n expect(\n ReactMount.getNode.argsForCall[0][0]\n ).toBe('testID');\n\n expect(stubNode.innerHTML).toBe('&nbsp;testContent');\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactDOMIDOperations-test\", module);\n",
"core/__tests__/ReactEventEmitter-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\")\n .dontMock('BrowserScroll')\n .dontMock('CallbackRegistry')\n .dontMock('EventPluginHub')\n .dontMock('ReactMount')\n .dontMock('ReactEventEmitter')\n .dontMock('ReactInstanceHandles')\n .dontMock('EventPluginHub')\n .dontMock('TapEventPlugin')\n .dontMock('TouchEventUtils')\n .dontMock('keyOf');\n\n\nvar keyOf = require(\"../../keyOf\");\nvar mocks = require(\"../../mocks\");\n\nvar EventPluginHub;\nvar ReactMount = require(\"../../ReactMount\");\nvar getID = ReactMount.getID;\nvar setID = ReactMount.setID;\nvar ReactEventEmitter;\nvar ReactTestUtils;\nvar TapEventPlugin;\n\nvar tapMoveThreshold;\nvar idCallOrder = [];\nvar recordID = function(id) {\n idCallOrder.push(id);\n};\nvar recordIDAndStopPropagation = function(id, event) {\n recordID(id);\n event.stopPropagation();\n};\nvar recordIDAndReturnFalse = function(id, event) {\n recordID(id);\n return false;\n};\nvar LISTENER = mocks.getMockFunction();\nvar ON_CLICK_KEY = keyOf({onClick: null});\nvar ON_TOUCH_TAP_KEY = keyOf({onTouchTap: null});\n\n\n/**\n * Since `ReactEventEmitter` is fairly well separated from the DOM, we can test\n * almost all of `ReactEventEmitter` without ever rendering anything in the DOM.\n * As long as we provide IDs that follow `React's` conventional id namespace\n * hierarchy. The only reason why we create these DOM nodes, is so that when we\n * feed them into `ReactEventEmitter` (through `ReactTestUtils`), the event\n * handlers may receive a DOM node to inspect.\n */\nvar CHILD = document.createElement('div');\nvar PARENT = document.createElement('div');\nvar GRANDPARENT = document.createElement('div');\nsetID(CHILD, '.reactRoot.[0].[0].[0]');\nsetID(PARENT, '.reactRoot.[0].[0]');\nsetID(GRANDPARENT, '.reactRoot.[0]');\n\nfunction registerSimpleTestHandler() {\n ReactEventEmitter.putListener(getID(CHILD), ON_CLICK_KEY, LISTENER);\n var listener = ReactEventEmitter.getListener(getID(CHILD), ON_CLICK_KEY);\n expect(listener).toEqual(LISTENER);\n return ReactEventEmitter.getListener(getID(CHILD), ON_CLICK_KEY);\n}\n\n\ndescribe('ReactEventEmitter', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n EventPluginHub = require(\"../../EventPluginHub\");\n TapEventPlugin = require(\"../../TapEventPlugin\");\n ReactMount = require(\"../../ReactMount\");\n getID = ReactMount.getID;\n setID = ReactMount.setID;\n ReactEventEmitter = require(\"../../ReactEventEmitter\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n idCallOrder = [];\n tapMoveThreshold = TapEventPlugin.tapMoveThreshold;\n ReactEventEmitter.ensureListening(false, document);\n EventPluginHub.injection.injectEventPluginsByName({\n TapEventPlugin: TapEventPlugin\n });\n });\n\n it('should store a listener correctly', function() {\n registerSimpleTestHandler();\n var listener = ReactEventEmitter.getListener(getID(CHILD), ON_CLICK_KEY);\n expect(listener).toBe(LISTENER);\n });\n\n it('should retrieve a listener correctly', function() {\n registerSimpleTestHandler();\n var listener = ReactEventEmitter.getListener(getID(CHILD), ON_CLICK_KEY);\n expect(listener).toEqual(LISTENER);\n });\n\n it('should clear all handlers when asked to', function() {\n registerSimpleTestHandler();\n ReactEventEmitter.deleteAllListeners(getID(CHILD));\n var listener = ReactEventEmitter.getListener(getID(CHILD), ON_CLICK_KEY);\n expect(listener).toBe(undefined);\n });\n\n it('should invoke a simple handler registered on a node', function() {\n registerSimpleTestHandler();\n ReactTestUtils.Simulate.click(CHILD);\n expect(LISTENER.mock.calls.length).toBe(1);\n });\n\n it('should not invoke handlers if ReactEventEmitter is disabled', function() {\n registerSimpleTestHandler();\n ReactEventEmitter.setEnabled(false);\n ReactTestUtils.Simulate.click(CHILD);\n expect(LISTENER.mock.calls.length).toBe(0);\n ReactEventEmitter.setEnabled(true);\n ReactTestUtils.Simulate.click(CHILD);\n expect(LISTENER.mock.calls.length).toBe(1);\n });\n\n it('should bubble simply', function() {\n ReactEventEmitter.putListener(\n getID(CHILD),\n ON_CLICK_KEY,\n recordID.bind(null, getID(CLine truncated
"core/__tests__/ReactIdentity-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\nvar ReactMount;\n\ndescribe('ReactIdentity', function() {\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n ReactMount = require(\"../../ReactMount\");\n });\n\n var idExp = /^\\.r\\[.+?\\](.*)$/;\n function checkId(child, expectedId) {\n var actual = idExp.exec(ReactMount.getID(child));\n var expected = idExp.exec(expectedId);\n expect(actual).toBeTruthy();\n expect(expected).toBeTruthy();\n expect(actual[1]).toEqual(expected[1]);\n }\n\n it('should allow keyed objects to express identity', function() {\n var instance =\n React.DOM.div(null, \n {\n first: React.DOM.div(null ),\n second: React.DOM.div(null )\n }\n );\n\n React.renderComponent(instance, document.createElement('div'));\n var node = instance.getDOMNode();\n reactComponentExpect(instance).toBeDOMComponentWithChildCount(2);\n checkId(node.childNodes[0], '.r[0].{first}');\n checkId(node.childNodes[1], '.r[0].{second}');\n });\n\n it('should allow key property to express identity', function() {\n var instance =\n React.DOM.div(null, \n React.DOM.div( {key:\"apple\"} ),\n React.DOM.div( {key:\"banana\"} ),\n React.DOM.div( {key:0} ),\n React.DOM.div( {key:123} )\n );\n\n React.renderComponent(instance, document.createElement('div'));\n var node = instance.getDOMNode();\n reactComponentExpect(instance).toBeDOMComponentWithChildCount(4);\n checkId(node.childNodes[0], '.r[0].{apple}');\n checkId(node.childNodes[1], '.r[0].{banana}');\n checkId(node.childNodes[2], '.r[0].{0}');\n checkId(node.childNodes[3], '.r[0].{123}');\n });\n\n it('should use instance identity', function() {\n\n var Wrapper = React.createClass({displayName: 'Wrapper',\n render: function() {\n return React.DOM.a( {key:\"i_get_overwritten\"}, this.props.children);\n }\n });\n\n var instance =\n React.DOM.div(null, \n Wrapper( {key:\"wrap1\"}, React.DOM.span( {key:\"squirrel\"} )),\n Wrapper( {key:\"wrap2\"}, React.DOM.span( {key:\"bunny\"} )),\n Wrapper(null, React.DOM.span( {key:\"chipmunk\"} ))\n );\n\n React.renderComponent(instance, document.createElement('div'));\n var node = instance.getDOMNode();\n reactComponentExpect(instance).toBeDOMComponentWithChildCount(3);\n\n checkId(node.childNodes[0], '.r[0].{wrap1}');\n checkId(node.childNodes[0].firstChild, '.r[0].{wrap1}.{squirrel}');\n checkId(node.childNodes[1], '.r[0].{wrap2}');\n checkId(node.childNodes[1].firstChild, '.r[0].{wrap2}.{bunny}');\n checkId(node.childNodes[2], '.r[0].[2]');\n checkId(node.childNodes[2].firstChild, '.r[0].[2].{chipmunk}');\n });\n\n function renderAComponentWithKeyIntoContainer(key, container) {\n var span1 = React.DOM.span( {key:key} );\n var span2 = React.DOM.span(null );\n\n var map = {};\n map[key] = span2;\n\n React.renderComponent(React.DOM.div(null, [span1, map]), container);\n\n expect(span1.getDOMNode()).not.toBe(null);\n expect(span2.getDOMNode()).not.toBe(null);\n\n checkId(span1.getDOMNode(), '.r[0].{' + key + '}');\n checkId(span2.getDOMNode(), '.r[0].[1]{' + key + '}');\n }\n\n it('should allow any character as a key, in a detached parent', function() {\n var detachedContainer = document.createElement('div');\n renderAComponentWithKeyIntoContainer(\"<'WEIRD/&\\\\key'>\", detachedContainer);\n });\n\n it('should allow any character as a key, in an attached parent', function() {\n // This test exists to protect against implementation details that\n // incorrectly query escaped IDs using DOM tools like getElementById.\n var attachedContainer = document.createElement('div');\n document.body.appendChild(attachedContainer);\n\n renderAComponentWithKeyIntoContainer(\"<'WEIRD/&\\\\key'>\", attachedContainer);\n\n document.body.removeChild(attachedContainer);\n });\n\n it('should not allow scripts in keys to execute', function() {\n var h4x0rKey =Line truncated
"core/__tests__/ReactInstanceHandles-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\nvar ReactMount = require(\"../../ReactMount\");\n\n/**\n * Ensure that all callbacks are invoked, passing this unique argument.\n */\nvar ARG = {arg: true};\nvar ARG2 = {arg2: true};\n\nvar ChildComponent = React.createClass({displayName: 'ChildComponent',\n render: function() {\n return (\n React.DOM.div( {ref:\"DIV\"}, \n React.DOM.div( {ref:\"DIV_1\"} ),\n React.DOM.div( {ref:\"DIV_2\"} )\n )\n );\n }\n});\n\nvar ParentComponent = React.createClass({displayName: 'ParentComponent',\n render: function() {\n return (\n React.DOM.div( {ref:\"P\"}, \n React.DOM.div( {ref:\"P_P1\"}, \n ChildComponent( {ref:\"P_P1_C1\"} ),\n ChildComponent( {ref:\"P_P1_C2\"} )\n ),\n React.DOM.div( {ref:\"P_OneOff\"} )\n )\n );\n }\n});\n\nfunction renderParentIntoDocument() {\n return ReactTestUtils.renderIntoDocument(ParentComponent(null ));\n}\n\ndescribe('ReactInstanceHandles', function() {\n var ReactInstanceHandles;\n\n var aggregatedArgs;\n function argAggregator(id, isUp, arg) {\n aggregatedArgs.push({\n id: id,\n isUp: isUp,\n arg: arg\n });\n }\n\n beforeEach(function() {\n ReactInstanceHandles = require(\"../../ReactInstanceHandles\");\n aggregatedArgs = [];\n });\n\n describe('isRenderedByReact', function() {\n it('should not crash on text nodes', function() {\n expect(function() {\n ReactMount.isRenderedByReact(document.createTextNode('yolo'));\n }).not.toThrow();\n });\n });\n\n describe('findComponentRoot', function() {\n it('should find the correct node with prefix sibling IDs', function() {\n var parentNode = document.createElement('div');\n var childNodeA = document.createElement('div');\n var childNodeB = document.createElement('div');\n parentNode.appendChild(childNodeA);\n parentNode.appendChild(childNodeB);\n\n ReactMount.setID(parentNode, '.react[0]');\n ReactMount.setID(childNodeA, '.react[0].0');\n ReactMount.setID(childNodeB, '.react[0].0:1');\n\n expect(\n ReactMount.findComponentRoot(\n parentNode,\n ReactMount.getID(childNodeB)\n )\n ).toBe(childNodeB);\n });\n\n it('should work around unidentified nodes', function() {\n var parentNode = document.createElement('div');\n var childNodeA = document.createElement('div');\n var childNodeB = document.createElement('div');\n parentNode.appendChild(childNodeA);\n parentNode.appendChild(childNodeB);\n\n ReactMount.setID(parentNode, '.react[0]');\n // No ID on `childNodeA`.\n ReactMount.setID(childNodeB, '.react[0].0:1');\n\n expect(\n ReactMount.findComponentRoot(\n parentNode,\n ReactMount.getID(childNodeB)\n )\n ).toBe(childNodeB);\n });\n\n it('should throw if a rendered element cannot be found', function() {\n var parentNode = document.createElement('table');\n var childNodeA = document.createElement('tbody');\n var childNodeB = document.createElement('tr');\n parentNode.appendChild(childNodeA);\n childNodeA.appendChild(childNodeB);\n\n ReactMount.setID(parentNode, '.react[0]');\n // No ID on `childNodeA`, it was \"rendered by the browser\".\n ReactMount.setID(childNodeB, '.react[0].1:0');\n\n expect(ReactMount.findComponentRoot(\n parentNode,\n ReactMount.getID(childNodeB)\n )).toBe(childNodeB);\n\n spyOn(console, 'error');\n expect(console.error.argsForCall.length).toBe(0);\n\n expect(function() {\n ReactMount.findComponentRoot(\n parentNode,\n ReactMount.getID(childNodeB) + \":junk\"\n );\n }).toThrow(\n 'Invariant Violation: findComponentRoot(..., .react[0].1:0:junk): ' +\n 'Unable to find element. This probably means the DOM was ' +\n 'unexpectedly mutated (e.g. by the browser).'\n );\n\n expect(console.error.argsForCall.length).toBe(1);\n });\n });\n\n describe('getReactRootIDFromNodeID', function() {\n it('should support strings', function() {\n var test = '.r[s_Line truncated
"core/__tests__/ReactMount-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\ndescribe('ReactMount', function() {\n var React = require(\"../../React\");\n var ReactMount = require(\"../../ReactMount\");\n\n it('should render different components in same root', function() {\n var container = document.createElement('container');\n document.documentElement.appendChild(container);\n\n ReactMount.renderComponent(React.DOM.div(null), container);\n expect(container.firstChild.nodeName).toBe('DIV');\n\n ReactMount.renderComponent(React.DOM.span(null), container);\n expect(container.firstChild.nodeName).toBe('SPAN');\n });\n\n it('should warn on unmountAndReleaseReactRootNode', function() {\n var _warn = console.warn;\n console.warn = mocks.getMockFunction();\n\n var container = document.createElement('container');\n ReactMount.renderComponent(React.DOM.span(null ), container);\n expect(console.warn.mock.calls.length).toBe(0);\n\n // This method should warn, nothing else should.\n ReactMount.unmountAndReleaseReactRootNode(container);\n expect(console.warn.mock.calls.length).toBe(1);\n\n ReactMount.renderComponent(React.DOM.span(null ), container);\n expect(console.warn.mock.calls.length).toBe(1);\n\n ReactMount.unmountComponentAtNode(container);\n expect(console.warn.mock.calls.length).toBe(1);\n\n console.warn = _warn;\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactMount-test\", module);\n",
"core/__tests__/ReactMountDestruction-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\n\ndescribe('ReactMount', function() {\n it(\"should destroy a react root upon request\", function() {\n var mainContainerDiv = document.createElement('div');\n document.documentElement.appendChild(mainContainerDiv);\n\n var instanceOne = (\n React.DOM.div( {className:\"firstReactDiv\"}\n )\n );\n var firstRootDiv = document.createElement('div');\n mainContainerDiv.appendChild(firstRootDiv);\n React.renderComponent(instanceOne, firstRootDiv);\n\n var instanceTwo = (\n React.DOM.div( {className:\"secondReactDiv\"}\n )\n );\n var secondRootDiv = document.createElement('div');\n mainContainerDiv.appendChild(secondRootDiv);\n React.renderComponent(instanceTwo, secondRootDiv);\n\n // Test that two react roots are rendered in isolation\n expect(firstRootDiv.getElementsByClassName('firstReactDiv').length)\n .toBe(1);\n expect(secondRootDiv.getElementsByClassName('secondReactDiv').length)\n .toBe(1);\n\n // Test that after unmounting each, they are no longer in the document.\n React.unmountComponentAtNode(firstRootDiv);\n expect(firstRootDiv.getElementsByClassName('firstReactDiv').length)\n .toBe(0);\n React.unmountComponentAtNode(secondRootDiv);\n expect(secondRootDiv.getElementsByClassName('secondReactDiv').length)\n .toBe(0);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactMountDestruction-test\", module);\n",
"core/__tests__/ReactMultiChild-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\ndescribe('ReactMultiChild', function() {\n var React;\n var setInnerHTML;\n\n // Only run this test suite if `Element.prototype.innerHTML` can be spied on.\n var innerHTMLDescriptor = Object.getOwnPropertyDescriptor(\n Element.prototype,\n 'innerHTML'\n );\n if (!innerHTMLDescriptor) {\n return;\n }\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n React = require(\"../../React\");\n\n Object.defineProperty(Element.prototype, 'innerHTML', {\n set: setInnerHTML = jasmine.createSpy().andCallFake(\n innerHTMLDescriptor.set\n )\n });\n });\n\n it('should only set `innerHTML` once on update', function() {\n var container = document.createElement('div');\n\n React.renderComponent(\n React.DOM.div(null, \n React.DOM.p(null, React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null ))\n ),\n container\n );\n // Warm the cache used by `getMarkupWrap`.\n React.renderComponent(\n React.DOM.div(null, \n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null ))\n ),\n container\n );\n expect(setInnerHTML).toHaveBeenCalled();\n var callCountOnMount = setInnerHTML.callCount;\n\n React.renderComponent(\n React.DOM.div(null, \n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null ),React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null ),React.DOM.span(null )),\n React.DOM.p(null, React.DOM.span(null ),React.DOM.span(null ),React.DOM.span(null ))\n ),\n container\n );\n expect(setInnerHTML.callCount).toBe(callCountOnMount + 1);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactMultiChild-test\", module);\n",
"core/__tests__/ReactMultiChildReconcile-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\");\n\nvar React = require(\"../../React\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\nvar ReactMount = require(\"../../ReactMount\");\n\nvar objMapKeyVal = require(\"../../objMapKeyVal\");\n\nvar stripEmptyValues = function(obj) {\n var ret = {};\n var name;\n for (name in obj) {\n if (!obj.hasOwnProperty(name)) {\n continue;\n }\n if (obj[name] !== null && obj[name] !== undefined) {\n ret[name] = obj[name];\n }\n }\n return ret;\n};\n\n/**\n * Child names is are wrapped in an prefix and suffix character. We strip those\n * out. This relies on a tiny implementation detail of the rendering system.\n */\nvar getOriginalKey = function(childName) {\n return childName.substr(1, childName.length - 2);\n};\n\n/**\n * Contains internal static internal state in order to test that updates to\n * existing children won't reinitialize components, when moving children -\n * reusing existing DOM/memory resources.\n */\nvar StatusDisplay = React.createClass({displayName: 'StatusDisplay',\n getInitialState: function() {\n return { internalState: Math.random() };\n },\n\n getStatus: function() {\n return this.props.status;\n },\n\n getInternalState: function() {\n return this.state.internalState;\n },\n\n render: function() {\n return (\n React.DOM.div(null, \n this.state.internalState\n )\n );\n }\n});\n\n/**\n * Displays friends statuses.\n */\nvar FriendsStatusDisplay = React.createClass({displayName: 'FriendsStatusDisplay',\n /**\n * Retrieves the rendered children in a nice format for comparing to the input\n * `this.props.usernameToStatus`. Gets the order directly from each rendered\n * child's `index` field. Refs are not maintained in the rendered order, and\n * neither is `this._renderedChildren` (surprisingly).\n */\n getStatusDisplays: function() {\n var name;\n var orderOfUsernames = [];\n var statusDisplays = this._renderedComponent._renderedChildren;\n for (name in statusDisplays) {\n var child = statusDisplays[name];\n var isPresent = !!child;\n if (isPresent) {\n orderOfUsernames[child._mountIndex] = getOriginalKey(name);\n }\n }\n var res = {};\n var i;\n for (i = 0; i < orderOfUsernames.length; i++) {\n var key = orderOfUsernames[i];\n res[key] = this.refs[key];\n }\n return res;\n },\n render: function() {\n var children = null;\n var key;\n for (key in this.props.usernameToStatus) {\n var status = this.props.usernameToStatus[key];\n children = children || {};\n children[key] = !status ? null :\n StatusDisplay( {ref:key, status:status} );\n }\n return (\n React.DOM.div(null, \n children\n )\n );\n }\n});\n\n\nfunction getInteralStateByUserName(statusDisplays) {\n return objMapKeyVal(statusDisplays, function(key, statusDisplay) {\n return statusDisplay.getInternalState();\n });\n}\n\n/**\n * Verifies that the rendered `StatusDisplay` instances match the `props` that\n * were responsible for allocating them. Checks the content of the user's status\n * message as well as the order of them.\n */\nfunction verifyStatuses(statusDisplays, props) {\n var nonEmptyStatusDisplays = stripEmptyValues(statusDisplays);\n var nonEmptyStatusProps = stripEmptyValues(props.usernameToStatus);\n var username;\n expect(Object.keys(nonEmptyStatusDisplays).length)\n .toEqual(Object.keys(nonEmptyStatusProps).length);\n for (username in nonEmptyStatusDisplays) {\n if (!nonEmptyStatusDisplays.hasOwnProperty(username)) {\n continue;\n }\n expect(nonEmptyStatusDisplays[username].getStatus())\n .toEqual(nonEmptyStatusProps[username]);\n }\n\n // now go the other way to make sure we got them all.\n for (username in nonEmptyStatusProps) {\n if (!nonEmptyStatusProps.hasOwnProperty(username)) {\n continue;\n }\n expect(nonEmptyStatusDisplays[username].getStatus())\n .toEqual(nonEmptyStatusProps[username]);\n }\n\n expect(Object.keys(nonEmptyStatusDisplays))\n .toEqual(Object.keys(nonEmptyStatusProps));\n}\n\n/**\n * For all statusDisplays that existed in the previous iteration of the\n * sequence, verify that the s Line truncated
"core/__tests__/ReactMultiChildText-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\");\n\nvar React = require(\"../../React\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\n\nvar reactComponentExpect = require(\"../../reactComponentExpect\");\n\nvar assertNodeText = function(instance, text) {\n expect(instance.getDOMNode().childNodes.length).toBe(1);\n expect(instance.getDOMNode().innerHTML).toBe('' + text);\n};\n\nvar assertEmptyNode = function(instance) {\n expect(instance.getDOMNode().childNodes.length).toBe(0);\n};\n\nvar assertMultiChild = function(instance, textOne, textTwo) {\n expect(instance.getDOMNode().childNodes.length).toBe(2);\n var firstTextDOMNode =\n reactComponentExpect(instance)\n .expectRenderedChildAt(0)\n .toBeTextComponent()\n .instance()\n .getDOMNode();\n expect(firstTextDOMNode.childNodes.length).toBe(textOne === '' ? 0 : 1);\n expect(firstTextDOMNode.innerHTML).toBe('' + textOne);\n\n var secondTextDOMNode =\n reactComponentExpect(instance)\n .expectRenderedChildAt(1)\n .toBeTextComponent()\n .instance()\n .getDOMNode();\n expect(secondTextDOMNode.childNodes.length).toBe(textTwo === '' ? 0 : 1);\n expect(secondTextDOMNode.innerHTML).toBe('' + textTwo);\n};\n\nvar assertSingleChild = function(instance, text) {\n expect(instance.getDOMNode().childNodes.length).toBe(1);\n var textDOMNode =\n reactComponentExpect(instance)\n .expectRenderedChildAt(0)\n .toBeTextComponent()\n .instance()\n .getDOMNode();\n expect(textDOMNode.childNodes.length).toBe(1);\n expect(textDOMNode.innerHTML).toBe('' + text);\n};\n\n// Helpers\nvar renderSingleTextChild = function(text) {\n var d = ReactTestUtils.renderIntoDocument(React.DOM.div(null, text));\n return d;\n};\nvar renderMultipleTextChildren = function(textOne, textTwo) {\n var d = ReactTestUtils.renderIntoDocument(React.DOM.div(null, textOne,textTwo));\n return d;\n};\n\nvar TestCompositeComponent = React.createClass({displayName: 'TestCompositeComponent',\n render: function() {\n return (\n React.DOM.div(null )\n );\n }\n});\n\n/**\n * ReactMultiChild DOM integration test. In ReactDOM components, we make sure\n * that single children that are strings are treated as \"content\" which is much\n * faster to render and update.\n */\ndescribe('ReactMultiChildText', function() {\n it('should render null as empty', function() {\n var d = renderSingleTextChild(null);\n // false should act exactly as a null child\n assertEmptyNode(d);\n });\n\n it('should render undefined as empty', function() {\n var d = renderSingleTextChild(undefined);\n // false should act exactly as a null child\n assertEmptyNode(d);\n });\n\n it('should render null as empty then switch to text node', function() {\n var d = renderSingleTextChild(null);\n // false should act exactly as a null child\n assertEmptyNode(d);\n d.replaceProps({children: 'hello'});\n assertNodeText(d, 'hello');\n });\n\n it('should render undefined as empty then switch to text node', function() {\n var d = renderSingleTextChild(undefined);\n // false should act exactly as a null child\n assertEmptyNode(d);\n d.replaceProps({children: 'hello'});\n assertNodeText(d, 'hello');\n });\n\n it('should render null as empty then switch to span children', function() {\n var d = renderSingleTextChild(null);\n // false should act exactly as a null child\n assertEmptyNode(d);\n d.replaceProps({children: ['hello', 'goodbye']});\n assertMultiChild(d, 'hello', 'goodbye');\n });\n\n it('should render null as empty then switch to span children', function() {\n var d = renderSingleTextChild(undefined);\n // false should act exactly as a null child\n assertEmptyNode(d);\n d.replaceProps({children: ['hello', 'goodbye']});\n assertMultiChild(d, 'hello', 'goodbye');\n });\n\n it('should render zero string as text node then switch to spans', function() {\n var d = renderSingleTextChild('0');\n // false should act exactly as a null child\n assertNodeText(d, '0');\n d.replaceProps({children: ['hello', 'goodbye']});\n assertMultiChild(d, 'hello', 'goodbye');\n });\n\n it('should render zero number as text node then switch to spans', Line truncated
"core/__tests__/ReactPropTransferer-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTestUtils;\nvar reactComponentExpect;\n\nvar TestComponent;\n\ndescribe('ReactPropTransferer', function() {\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n\n TestComponent = React.createClass({\n render: function() {\n return this.transferPropsTo(\n React.DOM.input(\n {className:\"textinput\",\n style:{display: 'block'},\n type:\"text\",\n value:\"\"}\n )\n );\n }\n });\n });\n\n it('should leave explicitly specified properties intact', function() {\n var instance = TestComponent( {type:\"radio\"} );\n ReactTestUtils.renderIntoDocument(instance);\n\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeComponentOfType(React.DOM.input)\n .scalarPropsEqual({\n className: 'textinput',\n style: {display: 'block'},\n type: 'text',\n value: ''\n });\n });\n\n it('should transfer unspecified properties', function() {\n var instance = TestComponent( {placeholder:\"Type here...\"} );\n ReactTestUtils.renderIntoDocument(instance);\n\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeComponentOfType(React.DOM.input)\n .scalarPropsEqual({placeholder: 'Type here...'});\n });\n\n it('should transfer using merge strategies', function() {\n var instance =\n TestComponent(\n {className:\"hidden_elem\",\n style:{width: '100%'}}\n );\n ReactTestUtils.renderIntoDocument(instance);\n\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeComponentOfType(React.DOM.input)\n .scalarPropsEqual({\n className: 'textinput hidden_elem',\n style: {\n display: 'block',\n width: '100%'\n }\n });\n });\n\n it('should not transfer children', function() {\n var ChildrenTestComponent = React.createClass({displayName: 'ChildrenTestComponent',\n render: function() {\n return this.transferPropsTo(React.DOM.div(null ));\n }\n });\n\n var instance =\n ChildrenTestComponent(null, \n React.DOM.span(null, \"Hello!\")\n );\n\n ReactTestUtils.renderIntoDocument(instance);\n reactComponentExpect(instance)\n .expectRenderedChild()\n .toBeDOMComponentWithTag('div')\n .toBeDOMComponentWithNoChildren();\n });\n\n it('should not transfer ref', function() {\n var RefTestComponent = React.createClass({displayName: 'RefTestComponent',\n render: function() {\n expect(this.props.ref).toBeUndefined();\n return React.DOM.div(null );\n }\n });\n var OuterRefTestComponent = React.createClass({displayName: 'OuterRefTestComponent',\n render: function() {\n return this.transferPropsTo(RefTestComponent(null ));\n }\n });\n var OuterOuterRefTestComponent = React.createClass({displayName: 'OuterOuterRefTestComponent',\n render: function() {\n return OuterRefTestComponent( {ref:\"testref\"} );\n }\n });\n\n ReactTestUtils.renderIntoDocument(OuterOuterRefTestComponent(null ));\n });\n\n it('should not transferPropsTo() a component you don\\'t own', function() {\n var Parent = React.createClass({displayName: 'Parent',\n render: function() {\n return Child(null, React.DOM.span(null ));\n }\n });\n\n var Child = React.createClass({displayName: 'Child',\n render: function() {\n return this.transferPropsTo(this.props.children);\n }\n });\n\n expect(function() {\n ReactTestUtils.renderIntoDocument(Parent(null ));\n }).toThrow(\n 'Invariant Violation: ' +\n 'Child: You can\\'t call transferPropsTo() on a component that you ' +\n 'don\\'t own, span. ' +\n 'This usually means you are calling transferPropsTo() on a component ' +\n 'passed in as props or children.'\n );\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactPropTransferer-test\", module);\n",
"core/__tests__/ReactPropTypes-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar Props = require(\"../../ReactPropTypes\");\n\nfunction typeCheck(declaration, value) {\n var props = {};\n if (arguments.length > 1) {\n props.testProp = value;\n }\n return declaration.bind(null, props, 'testProp', 'testComponent');\n}\n\ndescribe('Primitive Types', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n });\n\n it(\"should throw for invalid strings\", function() {\n expect(typeCheck(Props.string, [])).toThrow(\n 'Invariant Violation: Invalid prop `testProp` of type `array` ' +\n 'supplied to `testComponent`, expected `string`.'\n );\n expect(typeCheck(Props.string, false)).toThrow(\n 'Invariant Violation: Invalid prop `testProp` of type `boolean` ' +\n 'supplied to `testComponent`, expected `string`.'\n );\n expect(typeCheck(Props.string, 1)).toThrow(\n 'Invariant Violation: Invalid prop `testProp` of type `number` ' +\n 'supplied to `testComponent`, expected `string`.'\n );\n expect(typeCheck(Props.string, {})).toThrow(\n 'Invariant Violation: Invalid prop `testProp` of type `object` ' +\n 'supplied to `testComponent`, expected `string`.'\n );\n });\n\n it(\"should not throw for valid values\", function() {\n expect(typeCheck(Props.array, [])).not.toThrow();\n expect(typeCheck(Props.bool, false)).not.toThrow();\n expect(typeCheck(Props.func, function() {})).not.toThrow();\n expect(typeCheck(Props.number, 0)).not.toThrow();\n expect(typeCheck(Props.object, {})).not.toThrow();\n expect(typeCheck(Props.string, '')).not.toThrow();\n });\n\n it(\"should be implicitly optional and not throw without values\", function() {\n expect(typeCheck(Props.string, null)).not.toThrow();\n expect(typeCheck(Props.string, undefined)).not.toThrow();\n });\n\n it(\"should throw for missing required values\", function() {\n expect(typeCheck(Props.string.isRequired, null)).toThrow(\n 'Invariant Violation: Required prop `testProp` was not specified in ' +\n '`testComponent`.'\n );\n expect(typeCheck(Props.string.isRequired, undefined)).toThrow(\n 'Invariant Violation: Required prop `testProp` was not specified in ' +\n '`testComponent`.'\n );\n });\n});\n\ndescribe('Enum Types', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n });\n\n it(\"should throw for invalid strings\", function() {\n expect(typeCheck(Props.oneOf(['red', 'blue']), true)).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n '`testComponent`, expected one of [\"blue\",\"red\"].'\n );\n expect(typeCheck(Props.oneOf(['red', 'blue']), [])).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n '`testComponent`, expected one of [\"blue\",\"red\"].'\n );\n expect(typeCheck(Props.oneOf(['red', 'blue']), '')).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n '`testComponent`, expected one of [\"blue\",\"red\"].'\n );\n });\n\n it(\"should not throw for valid values\", function() {\n expect(typeCheck(Props.oneOf(['red', 'blue']), 'red')).not.toThrow();\n expect(typeCheck(Props.oneOf(['red', 'blue']), 'blue')).not.toThrow();\n });\n\n it(\"should be implicitly optional and not throw without values\", function() {\n expect(typeCheck(Props.oneOf(['red', 'blue']), null)).not.toThrow();\n expect(typeCheck(Props.oneOf(['red', 'blue']), undefined)).not.toThrow();\n });\n});\n\ndescribe('Instance Types', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n });\n\n it(\"should throw for invalid instances\", function() {\n function Person() {}\n\n expect(typeCheck(Props.instanceOf(Person), false)).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n '`testComponent`, expected instance of `Person`.'\n );\n expect(typeCheck(Props.instanceOf(Person), {})).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n '`testComponent`, expected instance of `Person`.'\n );\n expect(typeCheck(Props.instanceOf(Person), '')).toThrow(\n 'Invariant Violation: Invalid prop `testProp` supplied to ' +\n Line truncated
"core/__tests__/ReactRenderDocument-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar React;\nvar ReactMount;\n\nvar getTestDocument;\n\nvar testDocument;\n\ndescribe('rendering React components at document', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n\n React = require(\"../../React\");\n ReactMount = require(\"../../ReactMount\");\n getTestDocument = require(\"../../getTestDocument\");\n\n testDocument = getTestDocument();\n });\n\n it('should be able to switch root constructors via state', function() {\n if (!testDocument) {\n // These tests are not applicable in jst, since jsdom is buggy.\n return;\n }\n\n var Component = React.createClass({displayName: 'Component',\n render: function() {\n return (\n React.DOM.html(null, \n React.DOM.head(null, \n React.DOM.title(null, \"Hello World\")\n ),\n React.DOM.body(null, \n \" Hello world \"\n )\n )\n );\n }\n });\n\n var Component2 = React.createClass({displayName: 'Component2',\n render: function() {\n return (\n React.DOM.html(null, \n React.DOM.head(null, \n React.DOM.title(null, \"Hello World\")\n ),\n React.DOM.body(null, \n \" Goodbye world \"\n )\n )\n );\n }\n });\n\n var Root = React.createClass({displayName: 'Root',\n getInitialState: function() {\n return {toggled: false};\n },\n toggle: function() {\n this.setState({toggled: !this.state.toggled});\n },\n render: function() {\n if (this.state.toggled) {\n return Component2(null );\n }\n return Component(null );\n }\n });\n\n ReactMount.allowFullPageRender = true;\n var component = React.renderComponent(Root(null ), testDocument);\n expect(testDocument.body.innerHTML).toBe(' Hello world ');\n\n // Reactive update via state transition\n component.toggle();\n\n expect(testDocument.body.innerHTML).toBe(' Goodbye world ');\n\n });\n\n it('should be able to switch root constructors', function() {\n if (!testDocument) {\n // These tests are not applicable in jst, since jsdom is buggy.\n return;\n }\n\n var Component = React.createClass({displayName: 'Component',\n render: function() {\n return (\n React.DOM.html(null, \n React.DOM.head(null, \n React.DOM.title(null, \"Hello World\")\n ),\n React.DOM.body(null, \n \" Hello world \"\n )\n )\n );\n }\n });\n\n var Component2 = React.createClass({displayName: 'Component2',\n render: function() {\n return (\n React.DOM.html(null, \n React.DOM.head(null, \n React.DOM.title(null, \"Hello World\")\n ),\n React.DOM.body(null, \n \" Goodbye world \"\n )\n )\n );\n }\n });\n\n ReactMount.allowFullPageRender = true;\n React.renderComponent(Component(null ), testDocument);\n\n expect(testDocument.body.innerHTML).toBe(' Hello world ');\n\n // Reactive update\n React.renderComponent(Component2(null ), testDocument);\n\n expect(testDocument.body.innerHTML).toBe(' Goodbye world ');\n\n });\n\n it('should be able to mount into document', function() {\n if (!testDocument) {\n // These tests are not applicable in jst, since jsdom is buggy.\n return;\n }\n\n var Component = React.createClass({displayName: 'Component',\n render: function() {\n return (\n React.DOM.html(null, \n React.DOM.head(null, \n React.DOM.title(null, \"Hello World\")\n ),\n React.DOM.body(null, \n this.props.text\n )\n )\n );\n }\n });\n ReactMount.allowFullPageRender = true;\n React.renderComponent(Component( {text:\"Hello world\"} ), testDocument);\n\n expect(testDocument.body.innerHTML).toBe('Hello world');\n });\n\n it('should throw on full document render', function() {\n if (!testDocument) {\n // These tests are not app Line truncated
"core/__tests__/ReactStateSetters-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\nvar ReactStateSetters = require(\"../../ReactStateSetters\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\n\nvar TestComponent;\nvar TestComponentWithMixin;\n\ndescribe('ReactStateSetters', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n\n TestComponent = React.createClass({\n getInitialState: function() {\n return {foo: 'foo'};\n },\n\n render: function() {\n return React.DOM.div(null );\n }\n });\n\n TestComponentWithMixin = React.createClass({\n mixins: [ReactStateSetters.Mixin],\n\n getInitialState: function() {\n return {foo: 'foo'};\n },\n\n render: function() {\n return React.DOM.div(null );\n }\n });\n });\n\n it('createStateSetter should update state', function() {\n var instance = TestComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var setter = ReactStateSetters.createStateSetter(\n instance,\n function(a, b, c) {\n return {\n foo: a + b + c,\n bar: a * b * c\n };\n }\n );\n expect(instance.state).toEqual({foo: 'foo'});\n\n setter(1, 2, 3);\n expect(instance.state).toEqual({foo: 6, bar: 6});\n\n setter(10, 11, 12);\n expect(instance.state).toEqual({foo: 33, bar: 1320});\n });\n\n it('createStateKeySetter should update state', function() {\n var instance = TestComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var setter = ReactStateSetters.createStateKeySetter(instance, 'foo');\n\n expect(instance.state).toEqual({foo: 'foo'});\n\n setter('bar');\n expect(instance.state).toEqual({foo: 'bar'});\n\n setter('baz');\n expect(instance.state).toEqual({foo: 'baz'});\n });\n\n it('createStateKeySetter is memoized', function() {\n var instance = TestComponent(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var foo1 = ReactStateSetters.createStateKeySetter(instance, 'foo');\n var bar1 = ReactStateSetters.createStateKeySetter(instance, 'bar');\n\n var foo2 = ReactStateSetters.createStateKeySetter(instance, 'foo');\n var bar2 = ReactStateSetters.createStateKeySetter(instance, 'bar');\n\n expect(foo2).toBe(foo1);\n expect(bar2).toBe(bar1);\n });\n\n it('createStateSetter should update state from mixin', function() {\n var instance = TestComponentWithMixin(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var setter = instance.createStateSetter(\n function(a, b, c) {\n return {\n foo: a + b + c,\n bar: a * b * c\n };\n }\n );\n expect(instance.state).toEqual({foo: 'foo'});\n\n setter(1, 2, 3);\n expect(instance.state).toEqual({foo: 6, bar: 6});\n\n setter(10, 11, 12);\n expect(instance.state).toEqual({foo: 33, bar: 1320});\n });\n\n it('createStateKeySetter should update state with mixin', function() {\n var instance = TestComponentWithMixin(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var setter = instance.createStateKeySetter('foo');\n\n expect(instance.state).toEqual({foo: 'foo'});\n\n setter('bar');\n expect(instance.state).toEqual({foo: 'bar'});\n\n setter('baz');\n expect(instance.state).toEqual({foo: 'baz'});\n });\n\n it('createStateKeySetter is memoized with mixin', function() {\n var instance = TestComponentWithMixin(null );\n ReactTestUtils.renderIntoDocument(instance);\n expect(instance.state).toEqual({foo: 'foo'});\n\n var foo1 = instance.createStateKeySetter('foo');\n var bar1 = instance.createStateKeySetter('bar');\n\n var foo2 = instance.createStateKeySetter('foo');\n var bar2 = instance.createStateKeySetter('bar');\n\n expect(foo2).toBe(foo1);\n expect(bar2).toBe(bar1);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/ReactStateSetters-test\", module);\n",
"core/__tests__/ReactUpdates-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React;\nvar ReactTestUtils;\nvar ReactUpdates;\n\ndescribe('ReactUpdates', function() {\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n ReactUpdates = require(\"../../ReactUpdates\");\n });\n\n it('should batch state when updating state twice', function() {\n var updateCount = 0;\n var Component = React.createClass({displayName: 'Component',\n getInitialState: function() {\n return {x: 0};\n },\n componentDidUpdate: function() {\n updateCount++;\n },\n render: function() {\n return React.DOM.div(null, this.state.x);\n }\n });\n\n var instance = ReactTestUtils.renderIntoDocument(Component(null ));\n expect(instance.state.x).toBe(0);\n\n ReactUpdates.batchedUpdates(function() {\n instance.setState({x: 1});\n instance.setState({x: 2});\n expect(instance.state.x).toBe(0);\n expect(updateCount).toBe(0);\n });\n\n expect(instance.state.x).toBe(2);\n expect(updateCount).toBe(1);\n });\n\n it('should batch state when updating two different state keys', function() {\n var updateCount = 0;\n var Component = React.createClass({displayName: 'Component',\n getInitialState: function() {\n return {x: 0, y: 0};\n },\n componentDidUpdate: function() {\n updateCount++;\n },\n render: function() {\n return React.DOM.div(null, \"(\",this.state.x,\", \", this.state.y,\")\");\n }\n });\n\n var instance = ReactTestUtils.renderIntoDocument(Component(null ));\n expect(instance.state.x).toBe(0);\n expect(instance.state.y).toBe(0);\n\n ReactUpdates.batchedUpdates(function() {\n instance.setState({x: 1});\n instance.setState({y: 2});\n expect(instance.state.x).toBe(0);\n expect(instance.state.y).toBe(0);\n expect(updateCount).toBe(0);\n });\n\n expect(instance.state.x).toBe(1);\n expect(instance.state.y).toBe(2);\n expect(updateCount).toBe(1);\n });\n\n it('should batch state and props together', function() {\n var updateCount = 0;\n var Component = React.createClass({displayName: 'Component',\n getInitialState: function() {\n return {y: 0};\n },\n componentDidUpdate: function() {\n updateCount++;\n },\n render: function() {\n return React.DOM.div(null, \"(\",this.props.x,\", \", this.state.y,\")\");\n }\n });\n\n var instance = ReactTestUtils.renderIntoDocument(Component( {x:0} ));\n expect(instance.props.x).toBe(0);\n expect(instance.state.y).toBe(0);\n\n ReactUpdates.batchedUpdates(function() {\n instance.setProps({x: 1});\n instance.setState({y: 2});\n expect(instance.props.x).toBe(0);\n expect(instance.state.y).toBe(0);\n expect(updateCount).toBe(0);\n });\n\n expect(instance.props.x).toBe(1);\n expect(instance.state.y).toBe(2);\n expect(updateCount).toBe(1);\n });\n\n it('should batch parent/child state updates together', function() {\n var parentUpdateCount = 0;\n var Parent = React.createClass({displayName: 'Parent',\n getInitialState: function() {\n return {x: 0};\n },\n componentDidUpdate: function() {\n parentUpdateCount++;\n },\n render: function() {\n return React.DOM.div(null, Child( {ref:\"child\", x:this.state.x} ));\n }\n });\n var childUpdateCount = 0;\n var Child = React.createClass({displayName: 'Child',\n getInitialState: function() {\n return {y: 0};\n },\n componentDidUpdate: function() {\n childUpdateCount++;\n },\n render: function() {\n return React.DOM.div(null, this.props.x + this.state.y);\n }\n });\n\n var instance = ReactTestUtils.renderIntoDocument(Parent(null ));\n var child = instance.refs.child;\n expect(instance.state.x).toBe(0);\n expect(child.state.y).toBe(0);\n\n ReactUpdates.batchedUpdates(function() {\n instance.setState({x: 1});\n child.setState({y: 2});\n expect(instance.state.x).toBe(0);\n expect(child.state.y).toBe(0);\n expect(parentUpdateCount).toBe(0);\n expect(childUpdateCount).toBe(0);\n });\n\n expect(instance.stLine truncated
"core/__tests__/refs-destruction-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\nvar reactComponentExpect= require(\"../../reactComponentExpect\");\n\nvar TestComponent = React.createClass({displayName: 'TestComponent',\n render: function() {\n return (\n React.DOM.div(null, \n React.DOM.div( {ref:\"theInnerDiv\"}, \n \" Lets try to destroy this. \"\n )\n )\n );\n }\n});\n\ndescribe('refs-destruction', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n });\n\n it(\"should remove refs when destroying the parent\", function() {\n var testInstance = ReactTestUtils.renderIntoDocument(TestComponent(null ));\n reactComponentExpect(testInstance.refs.theInnerDiv)\n .toBeDOMComponentWithTag('div');\n expect(Object.keys(testInstance.refs || {}).length).toEqual(1);\n testInstance.unmountComponent();\n expect(Object.keys(testInstance.refs || {}).length).toEqual(0);\n });\n\n it(\"should remove refs when destroying the child\", function() {\n var testInstance = ReactTestUtils.renderIntoDocument(TestComponent(null ));\n reactComponentExpect(testInstance.refs.theInnerDiv)\n .toBeDOMComponentWithTag('div');\n expect(Object.keys(testInstance.refs || {}).length).toEqual(1);\n testInstance.refs.theInnerDiv.unmountComponent();\n expect(Object.keys(testInstance.refs || {}).length).toEqual(0);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"core/__tests__/refs-destruction-test\", module);\n",
"core/__tests__/refs-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\nvar ReactTestUtils = require(\"../../ReactTestUtils\");\n\nvar reactComponentExpect= require(\"../../reactComponentExpect\");\n\n\n/**\n * Counts clicks and has a renders an item for each click. Each item rendered\n * has a ref of the form \"clickLogN\".\n */\nvar ClickCounter = React.createClass({displayName: 'ClickCounter',\n getInitialState: function() {\n return {count: this.props.initialCount};\n },\n triggerReset: function() {\n this.setState({count: this.props.initialCount});\n },\n handleClick: function() {\n this.setState({count: this.state.count + 1});\n },\n render: function() {\n var children = [];\n var i;\n for (i=0; i < this.state.count; i++) {\n children.push(\n React.DOM.div(\n {className:\"clickLogDiv\",\n key:\"clickLog\" + i,\n ref:\"clickLog\" + i}\n )\n );\n }\n return (\n React.DOM.span( {className:\"clickIncrementer\", onClick:this.handleClick}, \n children\n )\n );\n }\n});\n\n/**\n * Only purpose is to test that refs are tracked even when applied to a\n * component that is injected down several layers. Ref systems are difficult to\n * build in such a way that ownership is maintained in an airtight manner.\n */\nvar GeneralContainerComponent = React.createClass({displayName: 'GeneralContainerComponent',\n render: function() {\n return React.DOM.div(null, this.props.children );\n }\n});\n\n/**\n * Notice how refs ownership is maintained even when injecting a component\n * into a different parent.\n */\nvar TestRefsComponent = React.createClass({displayName: 'TestRefsComponent',\n doReset: function() {\n this.refs.myCounter.triggerReset();\n },\n render: function() {\n return (\n React.DOM.div(null, \n React.DOM.div( {ref:\"resetDiv\", onClick:this.doReset}, \n \" Reset Me By Clicking This. \"\n ),\n GeneralContainerComponent( {ref:\"myContainer\"}, \n ClickCounter( {ref:\"myCounter\", initialCount:1})\n )\n )\n );\n }\n});\n\n/**\n * Render a TestRefsComponent and ensure that the main refs are wired up.\n */\nvar renderTestRefsComponent = function() {\n var testRefsComponent =\n ReactTestUtils.renderIntoDocument(TestRefsComponent(null ));\n\n reactComponentExpect(testRefsComponent)\n .toBeCompositeComponentWithType(TestRefsComponent);\n\n var generalContainer = testRefsComponent.refs.myContainer;\n var counter = testRefsComponent.refs.myCounter;\n\n reactComponentExpect(generalContainer)\n .toBeCompositeComponentWithType(GeneralContainerComponent);\n reactComponentExpect(counter)\n .toBeCompositeComponentWithType(ClickCounter);\n\n return testRefsComponent;\n};\n\n\nvar expectClickLogsLengthToBe = function(instance, length) {\n var clickLogs =\n ReactTestUtils.scryRenderedDOMComponentsWithClass(instance, 'clickLogDiv');\n expect(clickLogs.length).toBe(length);\n expect(Object.keys(instance.refs.myCounter.refs).length).toBe(length);\n};\n\ndescribe('reactiverefs', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n });\n\n /**\n * Ensure that for every click log there is a corresponding ref (from the\n * perspective of the injected ClickCounter component.\n */\n it(\"Should increase refs with an increase in divs\", function() {\n var testRefsComponent = renderTestRefsComponent();\n var clickIncrementer =\n ReactTestUtils.findRenderedDOMComponentWithClass(\n testRefsComponent,\n 'clickIncrementer'\n );\n\n expectClickLogsLengthToBe(testRefsComponent, 1);\n\n // After clicking the reset, there should still only be one click log ref.\n ReactTestUtils.Simulate.click(testRefsComponent.refs.resetDiv);\n expectClickLogsLengthToBe(testRefsComponent, 1);\n\n // Begin incrementing clicks (and therefore refs).\n ReactTestUtils.Simulate.click(clickIncrementer);\n expectClickLogsLengthToBe(testRefsComponent, 2);\n\n ReactTestUtils.Simulate.click(clickIncrementer);\n expectClickLogsLengthToBe(testRefsComponent, 3);\n\n // Now reset again\n ReactTestUtils.Simulate.click(testRefsComponent.refs.resetDiv);\n expectClickLogsLengthToBe(testRefsCompon Line truncated
"dom/__tests__/CSSPropertyOperations-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar React = require(\"../../React\");\n\ndescribe('CSSPropertyOperations', function() {\n var CSSPropertyOperations;\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n CSSPropertyOperations = require(\"../../CSSPropertyOperations\");\n });\n\n it('should create markup for simple styles', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n backgroundColor: '#3b5998',\n display: 'none'\n })).toBe('background-color:#3b5998;display:none;');\n });\n\n it('should ignore undefined styles', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n backgroundColor: undefined,\n display: 'none'\n })).toBe('display:none;');\n });\n\n it('should ignore null styles', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n backgroundColor: null,\n display: 'none'\n })).toBe('display:none;');\n });\n\n it('should return null for no styles', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n backgroundColor: null,\n display: null\n })).toBe(null);\n });\n\n it('should automatically append `px` to relevant styles', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n left: 0,\n margin: 16,\n opacity: 0.5,\n padding: '4px'\n })).toBe('left:0;margin:16px;opacity:0.5;padding:4px;');\n });\n\n it('should not append `px` to styles that might need a number', function() {\n expect(CSSPropertyOperations.createMarkupForStyles({\n fillOpacity: 1,\n fontWeight: 2,\n opacity: 3,\n orphans: 4,\n zIndex: 5,\n zoom: 6,\n lineHeight: 7\n })).toBe(\n 'fill-opacity:1;font-weight:2;opacity:3;orphans:4;z-index:5;zoom:6;' +\n 'line-height:7;'\n );\n });\n\n it('should set style attribute when styles exist', function() {\n var styles = {\n backgroundColor: '#000',\n display: 'none'\n };\n var div = React.DOM.div( {style:styles} );\n var root = document.createElement('div');\n React.renderComponent(div, root);\n expect(/style=\".*\"/.test(root.innerHTML)).toBe(true);\n });\n\n it('should not set style attribute when no styles exist', function() {\n var styles = {\n backgroundColor: null,\n display: null\n };\n var div = React.DOM.div( {style:styles} );\n var root = document.createElement('div');\n React.renderComponent(div, root);\n expect(/style=\".*\"/.test(root.innerHTML)).toBe(false);\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"dom/__tests__/CSSPropertyOperations-test\", module);\n",
"dom/__tests__/DOMPropertyOperations-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\ndescribe('DOMPropertyOperations', function() {\n var DOMPropertyOperations;\n var DOMProperty;\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n var ReactDefaultInjection = require(\"../../ReactDefaultInjection\");\n ReactDefaultInjection.inject();\n\n DOMPropertyOperations = require(\"../../DOMPropertyOperations\");\n DOMProperty = require(\"../../DOMProperty\");\n });\n\n describe('createMarkupForProperty', function() {\n\n it('should create markup for simple properties', function() {\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'name',\n 'simple'\n )).toBe('name=\"simple\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'name',\n false\n )).toBe('name=\"false\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'name',\n null\n )).toBe('');\n });\n\n it('should work with the id attribute', function() {\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'id',\n 'simple'\n )).toBe('id=\"simple\"');\n });\n\n it('should warn about incorrect casing', function() {\n spyOn(console, 'warn');\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'tabindex',\n '1'\n )).toBe(null);\n expect(console.warn.argsForCall.length).toBe(1);\n expect(console.warn.argsForCall[0][0]).toContain('tabIndex');\n });\n\n it('should warn about class', function() {\n spyOn(console, 'warn');\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'class',\n 'muffins'\n )).toBe(null);\n expect(console.warn.argsForCall.length).toBe(1);\n expect(console.warn.argsForCall[0][0]).toContain('className');\n });\n\n it('should create markup for boolean properties', function() {\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'checked',\n 'simple'\n )).toBe('checked=\"simple\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'checked',\n true\n )).toBe('checked=\"true\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'checked',\n false\n )).toBe('');\n });\n\n it('should create markup for custom attributes', function() {\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'aria-label',\n 'simple'\n )).toBe('aria-label=\"simple\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'aria-label',\n false\n )).toBe('aria-label=\"false\"');\n\n expect(DOMPropertyOperations.createMarkupForProperty(\n 'aria-label',\n null\n )).toBe('');\n });\n\n });\n\n describe('setValueForProperty', function() {\n var stubNode;\n\n beforeEach(function() {\n stubNode = document.createElement('div');\n });\n\n it('should set values as properties by default', function() {\n DOMPropertyOperations.setValueForProperty(stubNode, 'title', 'Tip!');\n expect(stubNode.title).toBe('Tip!');\n });\n\n it('should set values as attributes if necessary', function() {\n DOMPropertyOperations.setValueForProperty(stubNode, 'role', '#');\n expect(stubNode.getAttribute('role')).toBe('#');\n expect(stubNode.role).toBeUndefined();\n });\n\n it('should convert attribute values to string first', function() {\n // Browsers default to this behavior, but some test environments do not.\n // This ensures that we have consistent behavior.\n var obj = {toString: function() { return '<html>'; }};\n DOMPropertyOperations.setValueForProperty(stubNode, 'role', obj);\n expect(stubNode.getAttribute('role')).toBe('<html>');\n });\n\n it('should remove for falsey boolean properties', function() {\n DOMPropertyOperations.setValueForProperty(\n stubNode,\n 'allowFullScreen',\n false\n );\n expect(stubNode.hasAttribute('allowFullScreen')).toBe(false);\n });\n\n it('should use mutation method where applicable', function() {\n DOMPropertyOperations.setValueForProperty(\n stubNode,\n 'className',\n 'selected'\n );\n expect(stubNode.clasLine truncated
"dom/__tests__/Danger-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\nvar React = require(\"../../React\");\n\ndescribe('Danger', function() {\n\n describe('dangerouslyRenderMarkup', function() {\n var Danger;\n var transaction;\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n Danger = require(\"../../Danger\");\n\n var ReactReconcileTransaction = require(\"../../ReactReconcileTransaction\");\n transaction = new ReactReconcileTransaction();\n });\n\n it('should render markup', function() {\n var markup = (React.DOM.div(null )).mountComponent('.rX', transaction, 0);\n var output = Danger.dangerouslyRenderMarkup([markup])[0];\n\n expect(output.nodeName).toBe('DIV');\n });\n\n it('should render markup with props', function() {\n var markup = (React.DOM.div( {className:\"foo\"} )).mountComponent(\n '.rX',\n transaction,\n 0\n );\n var output = Danger.dangerouslyRenderMarkup([markup])[0];\n\n expect(output.nodeName).toBe('DIV');\n expect(output.className).toBe('foo');\n });\n\n it('should render wrapped markup', function() {\n var markup = (React.DOM.th(null )).mountComponent('.rX', transaction, 0);\n var output = Danger.dangerouslyRenderMarkup([markup])[0];\n\n expect(output.nodeName).toBe('TH');\n });\n\n it('should render lists of markup with similar `nodeName`', function() {\n var renderedMarkup = Danger.dangerouslyRenderMarkup(\n ['<p id=\"A\">1</p>', '<p id=\"B\">2</p>', '<p id=\"C\">3</p>']\n );\n\n expect(renderedMarkup.length).toBe(3);\n\n expect(renderedMarkup[0].nodeName).toBe('P');\n expect(renderedMarkup[1].nodeName).toBe('P');\n expect(renderedMarkup[2].nodeName).toBe('P');\n\n expect(renderedMarkup[0].innerHTML).toBe('1');\n expect(renderedMarkup[1].innerHTML).toBe('2');\n expect(renderedMarkup[2].innerHTML).toBe('3');\n });\n\n it('should render lists of markup with different `nodeName`', function() {\n var renderedMarkup = Danger.dangerouslyRenderMarkup(\n ['<p id=\"A\">1</p>', '<td id=\"B\">2</td>', '<p id=\"C\">3</p>']\n );\n\n expect(renderedMarkup.length).toBe(3);\n\n expect(renderedMarkup[0].nodeName).toBe('P');\n expect(renderedMarkup[1].nodeName).toBe('TD');\n expect(renderedMarkup[2].nodeName).toBe('P');\n\n expect(renderedMarkup[0].innerHTML).toBe('1');\n expect(renderedMarkup[1].innerHTML).toBe('2');\n expect(renderedMarkup[2].innerHTML).toBe('3');\n });\n\n it('should throw when rendering invalid markup', function() {\n expect(function() {\n Danger.dangerouslyRenderMarkup(['']);\n }).toThrow(\n 'Invariant Violation: dangerouslyRenderMarkup(...): Missing markup.'\n );\n\n spyOn(console, \"error\");\n\n var renderedMarkup = Danger.dangerouslyRenderMarkup(['<p></p><p></p>']);\n var args = console.error.argsForCall[0];\n\n expect(renderedMarkup.length).toBe(1);\n expect(renderedMarkup[0].nodeName).toBe('P');\n\n expect(console.error.argsForCall.length).toBe(1);\n\n expect(args.length).toBe(2);\n expect(args[0]).toBe('Danger: Discarding unexpected node:');\n expect(args[1].nodeName).toBe('P');\n });\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"dom/__tests__/Danger-test\", module);\n",
"dom/__tests__/getNodeForCharacterOffset-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar getTestDocument = require(\"../../getTestDocument\");\n\nvar getNodeForCharacterOffset = require(\"../../getNodeForCharacterOffset\");\n\n// Create node from HTML string\nfunction createNode(html) {\n var node = (getTestDocument() || document).createElement('div');\n node.innerHTML = html;\n return node;\n}\n\n// Check getNodeForCharacterOffset return value matches expected result.\nfunction expectNodeOffset(result, textContent, nodeOffset) {\n expect(result.node.textContent).toBe(textContent);\n expect(result.offset).toBe(nodeOffset);\n}\n\ndescribe('getNodeForCharacterOffset', function() {\n it('should handle siblings', function() {\n var node = createNode('<i>123</i><i>456</i><i>789</i>');\n\n expectNodeOffset(getNodeForCharacterOffset(node, 0), '123', 0);\n expectNodeOffset(getNodeForCharacterOffset(node, 4), '456', 1);\n });\n\n it('should handle trailing chars', function() {\n var node = createNode('<i>123</i><i>456</i><i>789</i>');\n\n expectNodeOffset(getNodeForCharacterOffset(node, 3), '123', 3);\n expectNodeOffset(getNodeForCharacterOffset(node, 9), '789', 3);\n });\n\n it('should handle trees', function() {\n var node = createNode(\n '<i>' +\n '<i>1</i>' +\n '<i>' +\n '<i>' +\n '<i>2</i>' +\n '<i></i>' +\n '</i>' +\n '</i>' +\n '<i>' +\n '3' +\n '<i>45</i>' +\n '</i>' +\n '</i>'\n );\n\n expectNodeOffset(getNodeForCharacterOffset(node, 3), '3', 1);\n expectNodeOffset(getNodeForCharacterOffset(node, 5), '45', 2);\n expect(getNodeForCharacterOffset(node, 10)).toBeUndefined();\n });\n\n it('should handle non-existent offset', function() {\n var node = createNode('<i>123</i>');\n\n expect(getNodeForCharacterOffset(node, -1)).toBeUndefined();\n expect(getNodeForCharacterOffset(node, 4)).toBeUndefined();\n });\n});\n\nrequire(\"../../mock-modules\").register(\"dom/__tests__/getNodeForCharacterOffset-test\", module);\n",
"dom/__tests__/mutateHTMLNodeWithMarkup-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar getTestDocument = require(\"../../getTestDocument\");\n\nvar mutateHTMLNodeWithMarkup = require(\"../../mutateHTMLNodeWithMarkup\");\n\ndescribe('mutateHTMLNodeWithMarkup', function() {\n it('should mutate the document html', function() {\n var html = '<html><head><title>test</title></head><body>test</body></html>';\n var testDocument = getTestDocument() || document;\n\n mutateHTMLNodeWithMarkup(testDocument.documentElement, html);\n expect(testDocument.body.innerHTML).toBe('test');\n });\n\n it('should change attributes', function() {\n var html = '<html><head><title>test</title></head><body>test</body></html>';\n var testDocument = getTestDocument() || document;\n\n mutateHTMLNodeWithMarkup(testDocument.documentElement, html);\n expect(!!testDocument.documentElement.getAttribute('lang')).toBe(false);\n\n var html2 = '<html lang=\"en\"><head><title>test</title></head>' +\n '<body>test</body></html>';\n mutateHTMLNodeWithMarkup(testDocument.documentElement, html2);\n expect(testDocument.documentElement.getAttribute('lang')).toBe('en');\n\n mutateHTMLNodeWithMarkup(testDocument.documentElement, html);\n expect(!!testDocument.documentElement.getAttribute('lang')).toBe(false);\n });\n});\n\nrequire(\"../../mock-modules\").register(\"dom/__tests__/mutateHTMLNodeWithMarkup-test\", module);\n",
"dom/components/__tests__/ReactDOMButton-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n/*jshint evil:true */\n\nvar mocks = require(\"../../../mocks\");\n\ndescribe('ReactDOMButton', function() {\n var React;\n var ReactTestUtils;\n\n var onClick = mocks.getMockFunction();\n\n function expectClickThru(button) {\n onClick.mockClear();\n ReactTestUtils.Simulate.click(button.getDOMNode());\n expect(onClick.mock.calls.length).toBe(1);\n }\n\n function expectNoClickThru(button) {\n onClick.mockClear();\n ReactTestUtils.Simulate.click(button.getDOMNode());\n expect(onClick.mock.calls.length).toBe(0);\n }\n\n function mounted(button) {\n ReactTestUtils.renderIntoDocument(button);\n return button;\n }\n\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactTestUtils = require(\"../../../ReactTestUtils\");\n });\n\n it('should forward clicks when it starts out not disabled', function() {\n expectClickThru(mounted(React.DOM.button( {onClick:onClick} )));\n });\n\n it('should not forward clicks when it starts out disabled', function() {\n expectNoClickThru(\n mounted(React.DOM.button( {disabled:true, onClick:onClick} ))\n );\n });\n\n it('should forward clicks when it becomes not disabled', function() {\n var btn = mounted(React.DOM.button( {disabled:true, onClick:onClick} ));\n btn.setProps({disabled: false});\n expectClickThru(btn);\n });\n\n it('should not forward clicks when it becomes disabled', function() {\n var btn = mounted(React.DOM.button( {onClick:onClick} ));\n btn.setProps({disabled: true});\n expectNoClickThru(btn);\n });\n\n it('should work correctly if the listener is changed', function() {\n var btn = mounted(\n React.DOM.button( {disabled:true, onClick:function() {}} )\n );\n\n btn.setProps({\n disabled: false,\n onClick: onClick\n });\n\n expectClickThru(btn);\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"dom/components/__tests__/ReactDOMButton-test\", module);\n",
"dom/components/__tests__/ReactDOMInput-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n/*jshint evil:true */\n\nvar emptyFunction = require(\"../../../emptyFunction\");\nvar mocks = require(\"../../../mocks\");\n\ndescribe('ReactDOMInput', function() {\n var React;\n var ReactLink;\n var ReactTestUtils;\n\n var renderTextInput;\n\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactLink = require(\"../../../ReactLink\");\n ReactTestUtils = require(\"../../../ReactTestUtils\");\n\n renderTextInput = function(component) {\n var stub = ReactTestUtils.renderIntoDocument(component);\n var node = stub.getDOMNode();\n return node;\n };\n });\n\n it('should display `defaultValue` of number 0', function() {\n var stub = React.DOM.input( {type:\"text\", defaultValue:0} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('0');\n });\n\n it('should display \"true\" for `defaultValue` of `true`', function() {\n var stub = React.DOM.input( {type:\"text\", defaultValue:true} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('true');\n });\n\n it('should display \"false\" for `defaultValue` of `false`', function() {\n var stub = React.DOM.input( {type:\"text\", defaultValue:false} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('false');\n });\n\n it('should display \"foobar\" for `defaultValue` of `objToString`', function() {\n var objToString = {\n toString: function() {\n return \"foobar\";\n }\n };\n\n var stub = React.DOM.input( {type:\"text\", defaultValue:objToString} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('foobar');\n });\n\n it('should display `value` of number 0', function() {\n var stub = React.DOM.input( {type:\"text\", value:0} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('0');\n });\n\n it('should allow setting `value` to `true`', function() {\n var stub = React.DOM.input( {type:\"text\", value:\"yolo\"} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('yolo');\n\n stub.replaceProps({value: true});\n expect(node.value).toEqual('true');\n });\n\n it(\"should allow setting `value` to `false`\", function() {\n var stub = React.DOM.input( {type:\"text\", value:\"yolo\"} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('yolo');\n\n stub.replaceProps({value: false});\n expect(node.value).toEqual('false');\n });\n\n it('should allow setting `value` to `objToString`', function() {\n var stub = React.DOM.input( {type:\"text\", value:\"foo\"} );\n var node = renderTextInput(stub);\n\n expect(node.value).toBe('foo');\n\n var objToString = {\n toString: function() {\n return \"foobar\";\n }\n };\n\n stub.replaceProps({value: objToString});\n expect(node.value).toEqual('foobar');\n });\n\n it('should properly control a value of number `0`', function() {\n var stub = React.DOM.input( {type:\"text\", value:0} );\n var node = renderTextInput(stub);\n\n node.value = 'giraffe';\n ReactTestUtils.Simulate.input(node);\n expect(node.value).toBe('0');\n });\n\n it('should control radio buttons', function() {\n var RadioGroup = React.createClass({displayName: 'RadioGroup',\n render: function() {\n return (\n React.DOM.div(null, \n React.DOM.input( {ref:\"a\", type:\"radio\", name:\"fruit\", checked:true} ),\"A \",\n React.DOM.input( {ref:\"b\", type:\"radio\", name:\"fruit\"} ),\"B \",\n React.DOM.form(null, \n React.DOM.input( {ref:\"c\", type:\"radio\", name:\"fruit\", defaultChecked:true} )\n )\n )\n );\n }\n });\n\n var stub = ReactTestUtils.renderIntoDocument(RadioGroup(null ));\n var aNode = stub.refs.a.getDOMNode();\n var bNode = stub.refs.b.getDOMNode();\n var cNode = stub.refs.c.getDOMNode();\n\n expect(aNode.checked).toBe(true);\n expect(bNode.checked).toBe(false);\n // c is in a separate form and shouldn't be affected at all here\n expect(cNode.checked).toBe(true);\n\n bNode.checked = true;\n // This next line isn't necessary in a proper browser environment, but\n // jsdom doesn't uncheck the others i Line truncated
"dom/components/__tests__/ReactDOMSelect-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n/*jshint evil:true */\n\nvar mocks = require(\"../../../mocks\");\n\ndescribe('ReactDOMSelect', function() {\n var React;\n var ReactLink;\n var ReactTestUtils;\n\n var renderSelect;\n\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactLink = require(\"../../../ReactLink\");\n ReactTestUtils = require(\"../../../ReactTestUtils\");\n\n renderSelect = function(component) {\n var stub = ReactTestUtils.renderIntoDocument(component);\n var node = stub.getDOMNode();\n return node;\n };\n });\n\n it('should allow setting `defaultValue`', function() {\n var stub =\n React.DOM.select( {defaultValue:\"giraffe\"}, \n React.DOM.option( {value:\"monkey\"}, \"A monkey!\"),\n React.DOM.option( {value:\"giraffe\"}, \"A giraffe!\"),\n React.DOM.option( {value:\"gorilla\"}, \"A gorilla!\")\n );\n var node = renderSelect(stub);\n\n expect(node.value).toBe('giraffe');\n\n // Changing `defaultValue` should do nothing.\n stub.setProps({defaultValue: 'gorilla'});\n expect(node.value).toEqual('giraffe');\n });\n\n it('should allow setting `defaultValue` with multiple', function() {\n var stub =\n React.DOM.select( {multiple:true, defaultValue:['giraffe', 'gorilla']}, \n React.DOM.option( {value:\"monkey\"}, \"A monkey!\"),\n React.DOM.option( {value:\"giraffe\"}, \"A giraffe!\"),\n React.DOM.option( {value:\"gorilla\"}, \"A gorilla!\")\n );\n var node = renderSelect(stub);\n\n expect(node.options[0].selected).toBe(false); // monkey\n expect(node.options[1].selected).toBe(true); // giraffe\n expect(node.options[2].selected).toBe(true); // gorilla\n\n // Changing `defaultValue` should do nothing.\n stub.setProps({defaultValue: ['monkey']});\n\n expect(node.options[0].selected).toBe(false); // monkey\n expect(node.options[1].selected).toBe(true); // giraffe\n expect(node.options[2].selected).toBe(true); // gorilla\n });\n\n it('should allow setting `value`', function() {\n var stub =\n React.DOM.select( {value:\"giraffe\"}, \n React.DOM.option( {value:\"monkey\"}, \"A monkey!\"),\n React.DOM.option( {value:\"giraffe\"}, \"A giraffe!\"),\n React.DOM.option( {value:\"gorilla\"}, \"A gorilla!\")\n );\n var node = renderSelect(stub);\n\n expect(node.value).toBe('giraffe');\n\n // Changing the `value` prop should change the selected option.\n stub.setProps({value: 'gorilla'});\n expect(node.value).toEqual('gorilla');\n });\n\n it('should allow setting `value` with multiple', function() {\n var stub =\n React.DOM.select( {multiple:true, value:['giraffe', 'gorilla']}, \n React.DOM.option( {value:\"monkey\"}, \"A monkey!\"),\n React.DOM.option( {value:\"giraffe\"}, \"A giraffe!\"),\n React.DOM.option( {value:\"gorilla\"}, \"A gorilla!\")\n );\n var node = renderSelect(stub);\n\n expect(node.options[0].selected).toBe(false); // monkey\n expect(node.options[1].selected).toBe(true); // giraffe\n expect(node.options[2].selected).toBe(true); // gorilla\n\n // Changing the `value` prop should change the selected options.\n stub.setProps({value: ['monkey']});\n\n expect(node.options[0].selected).toBe(true); // monkey\n expect(node.options[1].selected).toBe(false); // giraffe\n expect(node.options[2].selected).toBe(false); // gorilla\n });\n\n it('should allow setting `value` with `objectToString`', function() {\n var objectToString = {\n animal: \"giraffe\",\n toString: function() {\n return this.animal;\n }\n };\n\n var stub =\n React.DOM.select( {multiple:true, value:[objectToString]}, \n React.DOM.option( {value:\"monkey\"}, \"A monkey!\"),\n React.DOM.option( {value:\"giraffe\"}, \"A giraffe!\"),\n React.DOM.option( {value:\"gorilla\"}, \"A gorilla!\")\n );\n var node = renderSelect(stub);\n\n expect(node.options[0].selected).toBe(false); // monkey\n expect(node.options[1].selected).toBe(true); // giraffe\n expect(node.options[2].selected).toBe(false); // gorilla\n\n // Changing the `value` prop should change the selected options.\n objectToString.animal Line truncated
"dom/components/__tests__/ReactDOMTextarea-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\n/*jshint evil:true */\n\nvar mocks = require(\"../../../mocks\");\n\ndescribe('ReactDOMTextarea', function() {\n var React;\n var ReactLink;\n var ReactTestUtils;\n\n var renderTextarea;\n\n beforeEach(function() {\n React = require(\"../../../React\");\n ReactLink = require(\"../../../ReactLink\");\n ReactTestUtils = require(\"../../../ReactTestUtils\");\n\n renderTextarea = function(component) {\n var stub = ReactTestUtils.renderIntoDocument(component);\n var node = stub.getDOMNode();\n // Polyfilling the browser's quirky behavior.\n node.value = node.innerHTML;\n return node;\n };\n });\n\n it('should allow setting `defaultValue`', function() {\n var stub = React.DOM.textarea( {defaultValue:\"giraffe\"} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('giraffe');\n\n // Changing `defaultValue` should do nothing.\n stub.replaceProps({defaultValue: 'gorilla'});\n expect(node.value).toEqual('giraffe');\n });\n\n it('should display `defaultValue` of number 0', function() {\n var stub = React.DOM.textarea( {defaultValue:0} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('0');\n });\n\n it('should display \"false\" for `defaultValue` of `false`', function() {\n var stub = React.DOM.textarea( {type:\"text\", defaultValue:false} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('false');\n });\n\n it('should display \"foobar\" for `defaultValue` of `objToString`', function() {\n var objToString = {\n toString: function() {\n return \"foobar\";\n }\n };\n\n var stub = React.DOM.textarea( {type:\"text\", defaultValue:objToString} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('foobar');\n });\n\n it('should display `value` of number 0', function() {\n var stub = React.DOM.textarea( {value:0} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('0');\n });\n\n it('should allow setting `value` to `giraffe`', function() {\n var stub = React.DOM.textarea( {value:\"giraffe\"} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('giraffe');\n\n stub.replaceProps({value: 'gorilla'});\n expect(node.value).toEqual('gorilla');\n });\n\n it('should allow setting `value` to `true`', function() {\n var stub = React.DOM.textarea( {value:\"giraffe\"} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('giraffe');\n\n stub.replaceProps({value: true});\n expect(node.value).toEqual('true');\n });\n\n it('should allow setting `value` to `false`', function() {\n var stub = React.DOM.textarea( {value:\"giraffe\"} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('giraffe');\n\n stub.replaceProps({value: false});\n expect(node.value).toEqual('false');\n });\n\n it('should allow setting `value` to `objToString`', function() {\n var stub = React.DOM.textarea( {value:\"giraffe\"} );\n var node = renderTextarea(stub);\n\n expect(node.value).toBe('giraffe');\n\n var objToString = {\n toString: function() {\n return \"foo\";\n }\n };\n stub.replaceProps({value: objToString});\n expect(node.value).toEqual('foo');\n });\n\n it('should properly control a value of number `0`', function() {\n var stub = React.DOM.textarea( {value:0} );\n var node = renderTextarea(stub);\n\n node.value = 'giraffe';\n ReactTestUtils.Simulate.input(node);\n expect(node.value).toBe('0');\n });\n\n it('should treat children like `defaultValue`', function() {\n spyOn(console, 'warn');\n\n var stub = React.DOM.textarea(null, \"giraffe\");\n var node = renderTextarea(stub);\n\n expect(console.warn.argsForCall.length).toBe(1);\n expect(node.value).toBe('giraffe');\n\n // Changing children should do nothing, it functions like `defaultValue`.\n stub.replaceProps({children: 'gorilla'});\n expect(node.value).toEqual('giraffe');\n });\n\n it('should allow numbers as children', function() {\n spyOn(console, 'warn');\n var node = renderTextarea(React.DOM.textarea(null, 17));\n expect(console.warn.argsForCall.length).toBe(1);\n expect(node.value).toBe('17');\n }) Line truncated
"environment/__tests__/ReactServerRendering-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\")\n .dontMock('ExecutionEnvironment')\n .dontMock('React')\n .dontMock('ReactMount')\n .dontMock('ReactServerRendering')\n .dontMock('ReactTestUtils')\n .dontMock('ReactMarkupChecksum');\n\nvar mocks = require(\"../../mocks\");\n\nvar React;\nvar ReactMount;\nvar ReactTestUtils;\nvar ReactServerRendering;\nvar ReactMarkupChecksum;\nvar ExecutionEnvironment;\n\ndescribe('ReactServerRendering', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n React = require(\"../../React\");\n ReactMount = require(\"../../ReactMount\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n ExecutionEnvironment = require(\"../../ExecutionEnvironment\");\n ExecutionEnvironment.canUseDOM = false;\n ReactServerRendering = require(\"../../ReactServerRendering\");\n ReactMarkupChecksum = require(\"../../ReactMarkupChecksum\");\n });\n\n it('should generate simple markup', function() {\n var response;\n ReactServerRendering.renderComponentToString(\n React.DOM.span(null, \"hello world\"),\n function(response_) {\n response = response_;\n }\n );\n expect(response).toMatch(\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\" ' +\n ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '=\"[^\"]+\">hello world</span>'\n );\n });\n\n it('should render composite components', function() {\n var Parent = React.createClass({displayName: 'Parent',\n render: function() {\n return React.DOM.div(null, Child( {name:\"child\"} ));\n }\n });\n var Child = React.createClass({displayName: 'Child',\n render: function() {\n return React.DOM.span(null, \"My name is \", this.props.name);\n }\n });\n var response;\n ReactServerRendering.renderComponentToString(\n Parent(null ),\n function(response_) {\n response = response_;\n }\n );\n expect(response).toMatch(\n '<div ' + ReactMount.ATTR_NAME + '=\"[^\"]+\" ' +\n ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '=\"[^\"]+\">' +\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\">' +\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\">My name is </span>' +\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\">child</span>' +\n '</span>' +\n '</div>'\n );\n });\n\n it('should only execute certain lifecycle methods', function() {\n var lifecycle = [];\n var TestComponent = React.createClass({displayName: 'TestComponent',\n componentWillMount: function() {\n lifecycle.push('componentWillMount');\n },\n componentDidMount: function() {\n lifecycle.push('componentDidMount');\n },\n getInitialState: function() {\n lifecycle.push('getInitialState');\n return {name: 'TestComponent'};\n },\n render: function() {\n lifecycle.push('render');\n return React.DOM.span(null, \"Component name: \", this.state.name);\n },\n componentWillUpdate: function() {\n lifecycle.push('componentWillUpdate');\n },\n componentDidUpdate: function() {\n lifecycle.push('componentDidUpdate');\n },\n shouldComponentUpdate: function() {\n lifecycle.push('shouldComponentUpdate');\n },\n componentWillReceiveProps: function() {\n lifecycle.push('componentWillReceiveProps');\n },\n componentWillUnmount: function() {\n lifecycle.push('componentWillUnmount');\n }\n });\n\n var response;\n\n ReactServerRendering.renderComponentToString(\n TestComponent(null ),\n function (_response) {\n response = _response;\n }\n );\n\n expect(response).toMatch(\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\" ' +\n ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '=\"[^\"]+\">' +\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\">Component name: </span>' +\n '<span ' + ReactMount.ATTR_NAME + '=\"[^\"]+\">TestComponent</span>' +\n '</span>'\n );\n expect(lifecycle).toEqual(\n ['getInitialState', 'componentWillMount', 'render']\n );\n });\n\n it('should have the correct mounting behavior', function() {\n // This test is testinLine truncated
"environment/__tests__/ReactWebWorker-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\ndescribe('ReactWebWorker', function() {\n ;(typeof Worker == 'undefined' ? xit : it)('can run React in a web worker', function() {\n var done = false;\n var error;\n\n var worker = new Worker(window.ReactWebWorker_URL || '/src/test/worker.js?_=' + Date.now().toString(36));\n worker.addEventListener('message', function(e) {\n var data = JSON.parse(e.data);\n if (data.type == 'error') {\n error = data.message + \"\\n\" + data.stack;\n } else {\n expect(data.type).toBe('done');\n done = true;\n }\n });\n\n waitsFor(function() {\n return done;\n });\n runs(function() {\n if (error) {\n console.log(error);\n throw new Error(error);\n }\n });\n });\n});\n\nrequire(\"../../mock-modules\").register(\"environment/__tests__/ReactWebWorker-test\", module);\n",
"event/__tests__/EventPluginRegistry-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar merge = require(\"../../merge\");\n\ndescribe('EventPluginRegistry', function() {\n var EventPluginRegistry;\n var createPlugin;\n\n beforeEach(function() {\n EventPluginRegistry = require(\"../../EventPluginRegistry\");\n EventPluginRegistry._resetEventPlugins();\n\n createPlugin = function(properties) {\n return merge({extractEvents: function() {}}, properties);\n };\n });\n\n it('should be able to inject ordering before plugins', function() {\n var OnePlugin = createPlugin();\n var TwoPlugin = createPlugin();\n var ThreePlugin = createPlugin();\n\n EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']);\n EventPluginRegistry.injectEventPluginsByName({\n one: OnePlugin,\n two: TwoPlugin\n });\n EventPluginRegistry.injectEventPluginsByName({\n three: ThreePlugin\n });\n\n expect(EventPluginRegistry.plugins.length).toBe(3);\n expect(EventPluginRegistry.plugins[0]).toBe(OnePlugin);\n expect(EventPluginRegistry.plugins[1]).toBe(TwoPlugin);\n expect(EventPluginRegistry.plugins[2]).toBe(ThreePlugin);\n });\n\n it('should be able to inject plugins before and after ordering', function() {\n var OnePlugin = createPlugin();\n var TwoPlugin = createPlugin();\n var ThreePlugin = createPlugin();\n\n EventPluginRegistry.injectEventPluginsByName({\n one: OnePlugin,\n two: TwoPlugin\n });\n EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']);\n EventPluginRegistry.injectEventPluginsByName({\n three: ThreePlugin\n });\n\n expect(EventPluginRegistry.plugins.length).toBe(3);\n expect(EventPluginRegistry.plugins[0]).toBe(OnePlugin);\n expect(EventPluginRegistry.plugins[1]).toBe(TwoPlugin);\n expect(EventPluginRegistry.plugins[2]).toBe(ThreePlugin);\n });\n\n it('should be able to inject repeated plugins and out-of-order', function() {\n var OnePlugin = createPlugin();\n var TwoPlugin = createPlugin();\n var ThreePlugin = createPlugin();\n\n EventPluginRegistry.injectEventPluginsByName({\n one: OnePlugin,\n three: ThreePlugin\n });\n EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']);\n EventPluginRegistry.injectEventPluginsByName({\n two: TwoPlugin,\n three: ThreePlugin\n });\n\n expect(EventPluginRegistry.plugins.length).toBe(3);\n expect(EventPluginRegistry.plugins[0]).toBe(OnePlugin);\n expect(EventPluginRegistry.plugins[1]).toBe(TwoPlugin);\n expect(EventPluginRegistry.plugins[2]).toBe(ThreePlugin);\n });\n\n it('should throw if plugin does not implement `extractEvents`', function() {\n var BadPlugin = {};\n\n EventPluginRegistry.injectEventPluginOrder(['bad']);\n\n expect(function() {\n EventPluginRegistry.injectEventPluginsByName({\n bad: BadPlugin\n });\n }).toThrow(\n 'Invariant Violation: EventPluginRegistry: Event plugins must ' +\n 'implement an `extractEvents` method, but `bad` does not.'\n );\n });\n\n it('should throw if plugin does not exist in ordering', function() {\n var OnePlugin = createPlugin();\n var RandomPlugin = createPlugin();\n\n EventPluginRegistry.injectEventPluginOrder(['one']);\n\n expect(function() {\n EventPluginRegistry.injectEventPluginsByName({\n one: OnePlugin,\n random: RandomPlugin\n });\n }).toThrow(\n 'Invariant Violation: EventPluginRegistry: Cannot inject event plugins ' +\n 'that do not exist in the plugin ordering, `random`.'\n );\n });\n\n it('should throw if ordering is injected more than once', function() {\n var pluginOrdering = [];\n\n EventPluginRegistry.injectEventPluginOrder(pluginOrdering);\n\n expect(function() {\n EventPluginRegistry.injectEventPluginOrder(pluginOrdering);\n }).toThrow(\n 'Invariant Violation: EventPluginRegistry: Cannot inject event plugin ' +\n 'ordering more than once.'\n );\n });\n\n it('should throw if different plugins injected using same name', function() {\n var OnePlugin = createPlugin();\n var TwoPlugin = createPlugin();\n\n EventPluginRegistry.injectEventPluginsByName({same: OnePlugin});\n\n expect(function() {\n EventPluginRegistry.injectEventPluginsByName({same: TwoPluginLine truncated
"event/synthetic/__tests__/SyntheticEvent-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar SyntheticEvent;\n\ndescribe('SyntheticEvent', function() {\n var createEvent;\n\n beforeEach(function() {\n SyntheticEvent = require(\"../../../SyntheticEvent\");\n\n createEvent = function(nativeEvent) {\n return SyntheticEvent.getPooled({}, '', nativeEvent);\n };\n });\n\n it('should normalize `target` from the nativeEvent', function() {\n var target = document.createElement('div');\n var syntheticEvent = createEvent({srcElement: target});\n\n expect(syntheticEvent.target).toBe(target);\n expect(syntheticEvent.type).toBe(undefined);\n });\n\n it('should be able to `preventDefault`', function() {\n var nativeEvent = {};\n var syntheticEvent = createEvent(nativeEvent);\n\n expect(syntheticEvent.isDefaultPrevented()).toBe(false);\n syntheticEvent.preventDefault();\n expect(syntheticEvent.isDefaultPrevented()).toBe(true);\n\n expect(syntheticEvent.defaultPrevented).toBe(true);\n\n expect(nativeEvent.returnValue).toBe(false);\n });\n\n it('should be prevented if nativeEvent is prevented', function() {\n expect(\n createEvent({defaultPrevented: true}).isDefaultPrevented()\n ).toBe(true);\n expect(createEvent({returnValue: false}).isDefaultPrevented()).toBe(true);\n });\n\n it('should be able to `stopPropagation`', function() {\n var nativeEvent = {};\n var syntheticEvent = createEvent(nativeEvent);\n\n expect(syntheticEvent.isPropagationStopped()).toBe(false);\n syntheticEvent.stopPropagation();\n expect(syntheticEvent.isPropagationStopped()).toBe(true);\n\n expect(nativeEvent.cancelBubble).toBe(true);\n });\n\n it('should be able to `persist`', function() {\n var syntheticEvent = createEvent({});\n\n expect(syntheticEvent.isPersistent()).toBe(false);\n syntheticEvent.persist();\n expect(syntheticEvent.isPersistent()).toBe(true);\n });\n\n});\n\nrequire(\"../../../mock-modules\").register(\"event/synthetic/__tests__/SyntheticEvent-test\", module);\n",
"event/synthetic/__tests__/SyntheticWheelEvent-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar SyntheticWheelEvent;\n\ndescribe('SyntheticWheelEvent', function() {\n var createEvent;\n\n beforeEach(function() {\n SyntheticWheelEvent = require(\"../../../SyntheticWheelEvent\");\n\n createEvent = function(nativeEvent) {\n return SyntheticWheelEvent.getPooled({}, '', nativeEvent);\n };\n });\n\n it('should normalize properties from the Event interface', function() {\n var target = document.createElement('div');\n var syntheticEvent = createEvent({srcElement: target});\n\n expect(syntheticEvent.target).toBe(target);\n expect(syntheticEvent.type).toBe(undefined);\n });\n\n it('should normalize properties from the MouseEvent interface', function() {\n expect(createEvent({which: 2, button: 1}).button).toBe(1);\n });\n\n it('should normalize properties from the WheelEvent interface', function() {\n var standardEvent = createEvent({deltaX: 10, deltaY: -50});\n expect(standardEvent.deltaX).toBe(10);\n expect(standardEvent.deltaY).toBe(50);\n\n var webkitEvent = createEvent({wheelDeltaX: -10, wheelDeltaY: 50});\n expect(webkitEvent.deltaX).toBe(10);\n expect(webkitEvent.deltaY).toBe(50);\n });\n\n it('should be able to `preventDefault` and `stopPropagation`', function() {\n var nativeEvent = {};\n var syntheticEvent = createEvent(nativeEvent);\n\n expect(syntheticEvent.isDefaultPrevented()).toBe(false);\n syntheticEvent.preventDefault();\n expect(syntheticEvent.isDefaultPrevented()).toBe(true);\n\n expect(syntheticEvent.isPropagationStopped()).toBe(false);\n syntheticEvent.stopPropagation();\n expect(syntheticEvent.isPropagationStopped()).toBe(true);\n });\n\n it('should be able to `persist`', function() {\n var syntheticEvent = createEvent({});\n\n expect(syntheticEvent.isPersistent()).toBe(false);\n syntheticEvent.persist();\n expect(syntheticEvent.isPersistent()).toBe(true);\n });\n\n});\n\nrequire(\"../../../mock-modules\").register(\"event/synthetic/__tests__/SyntheticWheelEvent-test\", module);\n",
"eventPlugins/__tests__/AnalyticsEventPlugin-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @jsx React.DOM\n * @emails react-core\n */\n\n\"use strict\";\n\nvar mocks = require(\"../../mocks\");\n\ndescribe('AnalyticsEventPlugin', function() {\n var AnalyticsEventPluginFactory;\n var EventPluginHub;\n var EventPluginRegistry;\n var React;\n var ReactEventEmitter;\n var ReactTestUtils;\n\n var DefaultEventPluginOrder;\n var EnterLeaveEventPlugin;\n var ChangeEventPlugin;\n var ReactInstanceHandles;\n var SimpleEventPlugin;\n\n beforeEach(function() {\n AnalyticsEventPluginFactory = require(\"../../AnalyticsEventPluginFactory\");\n EventPluginHub = require(\"../../EventPluginHub\");\n EventPluginRegistry = require(\"../../EventPluginRegistry\");\n React = require(\"../../React\");\n ReactEventEmitter = require(\"../../ReactEventEmitter\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n\n EventPluginRegistry._resetEventPlugins();\n\n // Re-inject default events system after resetting.\n DefaultEventPluginOrder = require(\"../../DefaultEventPluginOrder\");\n EnterLeaveEventPlugin = require(\"../../EnterLeaveEventPlugin\");\n ChangeEventPlugin = require(\"../../ChangeEventPlugin\");\n ReactInstanceHandles = require(\"../../ReactInstanceHandles\");\n SimpleEventPlugin = require(\"../../SimpleEventPlugin\");\n\n EventPluginHub.injection.injectEventPluginOrder(DefaultEventPluginOrder);\n EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles);\n\n EventPluginHub.injection.injectEventPluginsByName({\n 'SimpleEventPlugin': SimpleEventPlugin,\n 'EnterLeaveEventPlugin': EnterLeaveEventPlugin,\n 'ChangeEventPlugin': ChangeEventPlugin\n });\n\n ReactEventEmitter.ensureListening(false, document);\n });\n\n it('should count events correctly', function() {\n var numClickEvents = 5;\n var numDoubleClickEvents = 7;\n var TEST_ANALYTICS_ID = 'test_analytics_id';\n var TestValidEvents = React.createClass({displayName: 'TestValidEvents',\n render: function() {\n return (\n React.DOM.div( {ref:\"testDiv\",\n 'data-analytics-id':TEST_ANALYTICS_ID,\n 'data-analytics-events':\"click,doubleClick\"}, \n \" Test \"\n )\n );\n }\n });\n var renderedComponent =\n ReactTestUtils.renderIntoDocument(TestValidEvents(null ));\n\n var cb = mocks.getMockFunction().mockImplementation(\n function(analyticsData) {\n expect(Object.keys(analyticsData).length).toBe(1);\n expect(Object.keys(analyticsData[TEST_ANALYTICS_ID]).length).toBe(2);\n expect(analyticsData[TEST_ANALYTICS_ID].click).toBe(numClickEvents);\n expect(analyticsData[TEST_ANALYTICS_ID].doubleClick).toBe(\n numDoubleClickEvents\n );\n }\n );\n\n EventPluginHub.injection.injectEventPluginsByName({\n AnalyticsEventPlugin:\n AnalyticsEventPluginFactory.createAnalyticsPlugin(cb)\n });\n\n // Simulate some clicks\n for (var i = 0; i < numClickEvents; i++) {\n ReactTestUtils.Simulate.click(renderedComponent.refs.testDiv);\n }\n // Simulate some double clicks\n for (i = 0; i < numDoubleClickEvents; i++) {\n ReactTestUtils.Simulate.doubleClick(renderedComponent.refs.testDiv);\n }\n // Simulate some other events not being tracked for analytics\n ReactTestUtils.Simulate.focus(renderedComponent.refs.testDiv);\n\n window.mockRunTimersOnce();\n expect(cb).toBeCalled();\n });\n\n it('error non no callback', function() {\n expect(function() {\n AnalyticsEventPluginFactory.createAnalyticsPlugin(null);\n }).toThrow();\n });\n\n it('error on invalid analytics events', function() {\n var TestInvalidEvents = React.createClass({displayName: 'TestInvalidEvents',\n render: function() {\n return (\n React.DOM.div( {ref:\"testDiv\",\n 'data-analytics-id':\"test_invalid_events\",\n 'data-analytics-events':\"click,123\"}, \n \" Test \"\n )\n );\n }\n });\n var renderedComponent =\n ReactTestUtils.renderIntoDocument(TestInvalidEvents(null ));\n\n var cb = mocks.getMockFunction();\n\n EventPluginHub.injection.injectEventPluginsByName({\n AnalyticsEventPlugin: AnalyticsEventPluginFactory.createAnalyticsPlugin(\n cb\nLine truncated
"eventPlugins/__tests__/ResponderEventPlugin-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar CallbackRegistry;\nvar EventConstants;\nvar EventPropagators;\nvar ReactInstanceHandles;\nvar ResponderEventPlugin;\nvar SyntheticEvent;\n\nvar GRANDPARENT_ID = '.r[0]';\nvar PARENT_ID = '.r[0].0';\nvar CHILD_ID = '.r[0].0.0';\n\nvar topLevelTypes;\nvar responderEventTypes;\nvar spies;\n\nvar DUMMY_NATIVE_EVENT = {};\nvar DUMMY_RENDERED_TARGET = {};\n\nvar onStartShouldSetResponder = function(id, cb, capture) {\n var registrationNames = responderEventTypes\n .startShouldSetResponder\n .phasedRegistrationNames;\n CallbackRegistry.putListener(\n id,\n capture ? registrationNames.captured : registrationNames.bubbled,\n cb\n );\n};\n\nvar onScrollShouldSetResponder = function(id, cb, capture) {\n var registrationNames = responderEventTypes\n .scrollShouldSetResponder\n .phasedRegistrationNames;\n CallbackRegistry.putListener(\n id,\n capture ? registrationNames.captured : registrationNames.bubbled,\n cb\n );\n};\n\nvar onMoveShouldSetResponder = function(id, cb, capture) {\n var registrationNames = responderEventTypes\n .moveShouldSetResponder\n .phasedRegistrationNames;\n CallbackRegistry.putListener(\n id,\n capture ? registrationNames.captured : registrationNames.bubbled,\n cb\n );\n};\n\n\nvar onResponderGrant = function(id, cb) {\n CallbackRegistry.putListener(\n id,\n responderEventTypes.responderGrant.registrationName,\n cb\n );\n};\n\nvar extractForTouchStart = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topTouchStart,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\nvar extractForTouchMove = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topTouchMove,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\nvar extractForTouchEnd = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topTouchEnd,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\nvar extractForMouseDown = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topMouseDown,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\nvar extractForMouseMove = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topMouseMove,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\n\nvar extractForMouseUp = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topMouseUp,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\nvar extractForScroll = function(renderedTargetID) {\n return ResponderEventPlugin.extractEvents(\n topLevelTypes.topScroll,\n DUMMY_NATIVE_EVENT,\n renderedTargetID,\n DUMMY_RENDERED_TARGET\n );\n};\n\n\nvar onGrantChild;\nvar onGrantParent;\nvar onGrantGrandParent;\n\n\nvar existsInExtraction = function(extracted, test) {\n if (Array.isArray(extracted)) {\n for (var i = 0; i < extracted.length; i++) {\n if (test(extracted[i])) {\n return true;\n }\n }\n } else if (extracted) {\n return test(extracted);\n }\n return false;\n};\n\n/**\n * Helper validators.\n */\nfunction assertGrantEvent(id, extracted) {\n var test = function(event) {\n return event instanceof SyntheticEvent &&\n event.dispatchConfig === responderEventTypes.responderGrant &&\n event.dispatchMarker === id;\n };\n expect(ResponderEventPlugin.getResponderID()).toBe(id);\n expect(existsInExtraction(extracted, test)).toBe(true);\n}\n\nfunction assertResponderMoveEvent(id, extracted) {\n var test = function(event) {\n return event instanceof SyntheticEvent &&\n event.dispatchConfig === responderEventTypes.responderMove &&\n event.dispatchMarker === id;\n };\n expect(ResponderEventPlugin.getResponderID()).toBe(id);\n expect(existsInExtraction(extracted, test)).toBe(true);\n}\n\nfunction assertTerminateEvent(id, extracted) {\n var test = function(event) {\n return event instanceof SyntheticEvent &&\n event.dispatchConfig === responderEventTypes.responderTeLine truncated
"utils/__tests__/ImmutableObject-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\")\n .dontMock('ImmutableObject');\n\nvar ImmutableObject;\n\n/**\n * To perform performance testing of using `ImmutableObject` vs. not using\n * `ImmutableObject`, such testing must be done with __DEV__ set to false.\n */\ndescribe('ImmutableObject', function() {\n var message;\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n ImmutableObject = require(\"../../ImmutableObject\");\n this.addMatchers({\n /**\n * Equivalent with respect to serialization. Must stringify because\n * constructors are different and other comparison methods will not\n * consider them structurally equal. Probably not useful for use outside\n * of this test module.\n */\n toBeSeriallyEqualTo: function(expected) {\n var actual = this.actual;\n var notText = this.isNot ? \" not\" : \"\";\n this.message = function () {\n return \"Expected \" + JSON.stringify(actual) + notText +\n \" to be serially equal to \" + JSON.stringify(expected);\n };\n\n return JSON.stringify(actual) === JSON.stringify(expected);\n }\n });\n });\n\n /**\n * We are in __DEV__ by default.\n */\n var testDev = function(message, testFunc) {\n it(message, testFunc);\n };\n\n var testProd = function(message, testFunc) {\n // Temporarily enter production mode\n window.true = false;\n it(message, testFunc);\n window.true = true;\n };\n\n var testDevAndProd = function(message, testFunc) {\n testDev(message + ':DEV', testFunc);\n testProd(message + ':PROD', testFunc);\n };\n\n testDev('should be running in DEV', function() {\n expect(window.true).toBe(true);\n });\n\n testDev('should require initial map to be an object', function() {\n expect(function() {\n new ImmutableObject([1,2,3]);\n }).toThrow();\n\n expect(function() {\n new ImmutableObject('asdf');\n }).toThrow();\n\n expect(function() {\n new ImmutableObject({oldField: 'asdf', fieldTwo: null});\n }).not.toThrow();\n });\n\n testDev('should not exceed maximum call stack size with nodes', function() {\n var node = document.createElement('div');\n var object = new ImmutableObject({node: node});\n expect(object.node).toBe(node);\n });\n\n testDevAndProd('should not throw when not mutating directly', function() {\n var io = new ImmutableObject({oldField: 'asdf'});\n expect(function() {\n ImmutableObject.set(io, {newField: null}); // not a mutation!\n }).not.toThrow();\n });\n\n testDev('should prevent shallow field addition when strict', function() {\n if (window.callPhantom) return;\n expect(function() {\n var io = new ImmutableObject({oldField: 'asdf'});\n io.newField = 'this will not work';\n }).toThrow();\n });\n\n testDev('should prevent shallow field mutation when strict', function() {\n if (window.callPhantom) return;\n expect(function() {\n var io = new ImmutableObject({oldField: 'asdf'});\n io.oldField = 'this will not work!';\n }).toThrow();\n });\n\n testDev('should prevent deep field addition when strict', function() {\n if (window.callPhantom) return;\n expect(function() {\n var io =\n new ImmutableObject({shallowField: {deepField: {oldField: null}}});\n io.shallowField.deepField.oldField = 'this will not work!';\n }).toThrow();\n });\n\n testDev('should prevent deep field mutation when strict', function() {\n if (window.callPhantom) return;\n expect(function() {\n var io =\n new ImmutableObject({shallowField: {deepField: {oldField: null}}});\n io.shallowField.deepField.newField = 'this will not work!';\n }).toThrow();\n });\n\n testDevAndProd(\n 'should create object with same structure when set with {}',\n function() {\n var beforeIO =\n new ImmutableObject({shallowField: {deepField: {oldField: null}}});\n var afterIO = ImmutableObject.set(beforeIO, {});\n expect(afterIO).toBeSeriallyEqualTo(beforeIO);\n expect(afterIO).not.toBe(beforeIO);\n }\n );\n\n testDevAndProd(\n 'should create distinct object with shallow field insertion',\n function() {\n var beforeStructure = {\n oldShallowField: {\n Line truncated
"utils/__tests__/OrderedMap-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar OrderedMap;\n\n/**\n * Shared, reusable objects.\n */\nvar hasEmptyStringKey = {\n 'thisKeyIsFine': {data: []},\n '': {thisShouldCauseAFailure: []},\n 'thisKeyIsAlsoFine': {data: []}\n};\n\n/**\n * Used as map/forEach callback.\n */\nvar duplicate = function(itm, key, count) {\n return {\n uniqueID: itm.uniqueID,\n val: itm.val + key + count + this.justToTestScope\n };\n};\n\n// Should not be allowed - because then null/'null' become impossible to\n// distinguish. Every key MUST be a string period!\nvar hasNullAndUndefStringKey = [\n {uniqueID: 'undefined', val: 'thisIsUndefined'},\n {uniqueID: 'null', val: 'thisIsNull'}\n];\nvar hasNullKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: null, data: []}\n];\n\nvar hasObjectKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: {}, data: []}\n];\n\nvar hasArrayKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: [], data: []}\n];\n\n// This should be allowed\nvar hasNullStringKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: 'null', data: []}\n];\n\nvar hasUndefinedKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: undefined, data: []}\n];\n\nvar hasUndefinedStringKey = [\n {uniqueID: 'thisKeyIsFine', data: []},\n {uniqueID: 'thisKeyIsAlsoFine', data: []},\n {uniqueID: 'undefined', data: []}\n];\n\nvar hasPositiveNumericKey = [\n {uniqueID: 'notANumber', data: []},\n {uniqueID: '5', data: []},\n {uniqueID: 'notAnotherNumber',data: []}\n];\n\nvar hasZeroStringKey = [\n {uniqueID: 'greg', data: 'grego'},\n {uniqueID: '0', data: '0o'},\n {uniqueID: 'tom', data: 'tomo'}\n];\n\nvar hasZeroNumberKey = [\n {uniqueID: 'greg', data: 'grego'},\n {uniqueID: 0, data: '0o'},\n {uniqueID: 'tom', data: 'tomo'}\n];\n\nvar hasAllNumericStringKeys = [\n {uniqueID: '0', name: 'Gregory'},\n {uniqueID: '2', name: 'James'},\n {uniqueID: '1', name: 'Tom'}\n];\n\nvar hasAllNumericKeys = [\n {uniqueID: 0, name: 'Gregory'},\n {uniqueID: 2, name: 'James'},\n {uniqueID: 1, name: 'Tom'}\n];\n\nvar hasAllValidKeys = [\n {uniqueID: 'keyOne', value: 'valueOne'},\n {uniqueID: 'keyTwo', value: 'valueTwo'}\n];\n\nvar hasDuplicateKeys = [\n {uniqueID: 'keyOne', value: 'valueOne'},\n {uniqueID: 'keyTwo', value: 'valueTwo'},\n {uniqueID: 'keyOne', value: 'valueThree'}\n];\n\nvar idEntities = [\n {uniqueID: 'greg', name: 'Gregory'},\n {uniqueID: 'james', name: 'James'},\n {uniqueID: 'tom', name: 'Tom'}\n];\n\nvar hasEmptyKey = [\n {uniqueID: 'greg', name: 'Gregory'},\n {uniqueID: '', name: 'James'},\n {uniqueID: 'tom', name: 'Tom'}\n];\n\nvar extractUniqueID = function(entity) {\n return entity.uniqueID;\n};\n\ndescribe('OrderedMap', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n OrderedMap = require(\"../../OrderedMap\");\n });\n\n it('should create according to simple object with keys', function() {\n OrderedMap.fromArray(hasAllValidKeys, extractUniqueID);\n // Iterate over and ensure key order.\n });\n\n it('should create from array when providing an identity CB', function() {\n expect(function() {\n OrderedMap.fromArray(idEntities, extractUniqueID);\n }).not.toThrow();\n });\n\n it('should throw if constructing from Array without identity CB', function() {\n OrderedMap.fromArray(idEntities, extractUniqueID);\n // Iterate and ensure key order\n });\n\n it('should not throw when fromArray extracts a numeric key', function() {\n expect(function() {\n OrderedMap.fromArray(hasPositiveNumericKey, extractUniqueID);\n }).not.toThrow();\n\n });\n\n it('should throw when any key is the empty string', function() {\n expect(function() {\n OrderedMap.fromArray(hasEmptyKey, extractUniqueID);\n }).toThrow();\n });\n\n it('should not throw when a key is the string \"undefined\" or \"null\"',\n function() {\n var om = OrderedMap.fromArray(hasNullAndUndefStringKey, extractUniqueID);\n expect(om.length).toBe(2);\n expect(om.indexOfKey('undefined')).toBe(0);\n expect(om.inLine truncated
"utils/__tests__/ReactChildren-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n * @jsx React.DOM\n */\n\n\"use strict\";\n\ndescribe('ReactChildren', function() {\n var ReactChildren;\n var React;\n\n beforeEach(function() {\n ReactChildren = require(\"../../ReactChildren\");\n React = require(\"../../React\");\n });\n\n\n it('should support identity for simple', function() {\n var callback = jasmine.createSpy().andCallFake(function (kid, index) {\n return kid;\n });\n\n var simpleKid = React.DOM.span( {key:\"simple\"} );\n\n // First pass children into a component to fully simulate what happens when\n // using structures that arrive from transforms.\n\n var instance = React.DOM.div(null, simpleKid);\n ReactChildren.forEach(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n callback.reset();\n var mappedChildren = ReactChildren.map(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n expect(mappedChildren[Object.keys(mappedChildren)[0]]).toBe(simpleKid);\n });\n\n it('should treat single arrayless child as being in array', function() {\n var callback = jasmine.createSpy().andCallFake(function (kid, index) {\n return kid;\n });\n\n var simpleKid = React.DOM.span(null );\n var instance = React.DOM.div(null, simpleKid);\n ReactChildren.forEach(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n callback.reset();\n var mappedChildren = ReactChildren.map(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n expect(mappedChildren[Object.keys(mappedChildren)[0]]).toBe(simpleKid);\n });\n\n it('should treat single child in array as expected', function() {\n var callback = jasmine.createSpy().andCallFake(function (kid, index) {\n return kid;\n });\n\n var simpleKid = React.DOM.span(null );\n var instance = React.DOM.div(null, [simpleKid]);\n ReactChildren.forEach(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n callback.reset();\n var mappedChildren = ReactChildren.map(instance.props.children, callback);\n expect(callback).toHaveBeenCalledWith(simpleKid, 0);\n expect(mappedChildren[Object.keys(mappedChildren)[0]]).toBe(simpleKid);\n });\n\n it('should pass key to returned component', function() {\n var mapFn = function (kid, index) {\n return React.DOM.div(null, kid);\n };\n\n var simpleKid = React.DOM.span( {key:\"simple\"} );\n\n var instance = React.DOM.div(null, simpleKid);\n var mappedChildren = ReactChildren.map(instance.props.children, mapFn);\n\n var mappedKeys = Object.keys(mappedChildren);\n expect(mappedKeys.length).toBe(1);\n expect(mappedChildren[mappedKeys[0]]).not.toBe(simpleKid);\n expect(mappedChildren[mappedKeys[0]].props.children).toBe(simpleKid);\n expect(mappedKeys[0]).toBe('{simple}');\n });\n\n it('should invoke callback with the right context', function() {\n var lastContext;\n var callback = function (kid, index) {\n lastContext = this;\n return this;\n };\n\n var scopeTester = {};\n\n var simpleKid = React.DOM.span( {key:\"simple\"} );\n var instance = React.DOM.div(null, simpleKid);\n ReactChildren.forEach(instance.props.children, callback, scopeTester);\n expect(lastContext).toBe(scopeTester);\n\n var mappedChildren =\n ReactChildren.map(instance.props.children, callback, scopeTester);\n\n var mappedKeys = Object.keys(mappedChildren);\n expect(mappedKeys.length).toBe(1);\n expect(mappedChildren[mappedKeys[0]]).toBe(scopeTester);\n });\n\n it('should be called for each child', function() {\n var zero = React.DOM.div( {key:\"keyZero\"} );\n var one = null;\n var two = React.DOM.div( {key:\"keyTwo\"} );\n var three = null;\n var four = React.DOM.div( {key:\"keyFour\"} );\n\n var zeroMapped = React.DOM.div( {key:\"giraffe\"} ); // Key should be overridden\n var oneMapped = null; // Key should be added even if we don't supply it!\n var twoMapped = React.DOM.div(null ); // Key should be added even if not supplied!\n var threeMapped = React.DOM.span(null ); // Map from null to something.\n var fourMapped = React.DOM.div( {key:\"keyFour\"} );\n\n var callback =Line truncated
"utils/__tests__/Transaction-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nvar Transaction;\nvar mixInto;\n\nvar INIT_ERRORED = 'initErrored'; // Just a dummy value to check for.\ndescribe('Transaction', function() {\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n Transaction = require(\"../../Transaction\");\n mixInto = require(\"../../mixInto\");\n });\n\n /**\n * We should not invoke closers for inits that failed. We should pass init\n * return values to closers when those inits are successful. We should not\n * invoke the actual method when any of the initializers fail.\n */\n it('should invoke closers with/only-with init returns', function() {\n var throwInInit = function() {\n throw new Error('close[0] should receive Transaction.OBSERVED_ERROR');\n };\n\n var performSideEffect;\n var dontPerformThis = function() {\n performSideEffect = 'This should never be set to this';\n };\n\n /**\n * New test Transaction subclass.\n */\n var TestTransaction = function() {\n this.reinitializeTransaction();\n this.firstCloseParam = INIT_ERRORED; // WON'T be set to something else\n this.secondCloseParam = INIT_ERRORED; // WILL be set to something else\n this.lastCloseParam = INIT_ERRORED; // WON'T be set to something else\n };\n mixInto(TestTransaction, Transaction.Mixin);\n TestTransaction.prototype.getTransactionWrappers = function() {\n return [\n {\n initialize: throwInInit,\n close: function(initResult) {\n this.firstCloseParam = initResult;\n }\n },\n {\n initialize: function() { return 'asdf'; },\n close: function(initResult) {\n this.secondCloseParam = initResult;\n }\n },\n {\n initialize: throwInInit,\n close: function(initResult) {\n this.lastCloseParam = initResult;\n }\n }\n ];\n };\n\n var transaction = new TestTransaction();\n\n expect(function() {\n transaction.perform(dontPerformThis);\n }).toThrow();\n\n expect(performSideEffect).toBe(undefined);\n expect(transaction.firstCloseParam).toBe(INIT_ERRORED);\n expect(transaction.secondCloseParam).toBe('asdf');\n expect(transaction.lastCloseParam).toBe(INIT_ERRORED);\n expect(transaction.isInTransaction()).toBe(false);\n });\n\n it('should invoke closers and wrapped method when inits success', function() {\n\n var performSideEffect;\n /**\n * New test Transaction subclass.\n */\n var TestTransaction = function() {\n this.reinitializeTransaction();\n this.firstCloseParam = INIT_ERRORED; // WON'T be set to something else\n this.secondCloseParam = INIT_ERRORED; // WILL be set to something else\n this.lastCloseParam = INIT_ERRORED; // WON'T be set to something else\n };\n mixInto(TestTransaction, Transaction.Mixin);\n TestTransaction.prototype.getTransactionWrappers = function() {\n return [\n {\n initialize: function() {\n return 'firstResult';\n },\n close: function(initResult) {\n this.firstCloseParam = initResult;\n }\n },\n {\n initialize: function() {\n return 'secondResult';\n },\n close: function(initResult) {\n this.secondCloseParam = initResult;\n }\n },\n {\n initialize: function() {\n return 'thirdResult';\n },\n close: function(initResult) {\n this.lastCloseParam = initResult;\n }\n }\n ];\n };\n\n var transaction = new TestTransaction();\n\n transaction.perform(function() {\n performSideEffect = 'SIDE_EFFECT';\n });\n\n expect(performSideEffect).toBe('SIDE_EFFECT');\n expect(transaction.firstCloseParam).toBe('firstResult');\n expect(transaction.secondCloseParam).toBe('secondResult');\n expect(transaction.lastCloseParam).toBe('thirdResult');\n expect(transaction.isInTransaction()).toBe(false);\n });\n\n /**\n * When the operation throws, the transaction should throw, but all of the\n * error-free closers should execute gracefully without issue. If a closer\n * throws an error, the transaction should pre Line truncated
"utils/__tests__/escapeTextForBrowser-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\ndescribe('escapeTextForBrowser', function() {\n\n var escapeTextForBrowser = require(\"../../escapeTextForBrowser\");\n\n it('should escape boolean to string', function() {\n expect(escapeTextForBrowser(true)).toBe('true');\n expect(escapeTextForBrowser(false)).toBe('false');\n });\n\n it('should escape object to string', function() {\n var escaped = escapeTextForBrowser({\n toString: function() {\n return 'ponys';\n }\n });\n\n expect(escaped).toBe('ponys');\n });\n\n it('should escape number to string', function() {\n expect(escapeTextForBrowser(42)).toBe('42');\n });\n\n it('should escape string', function() {\n var escaped = escapeTextForBrowser('<script type=\\'\\' src=\"\"></script>');\n expect(escaped).not.toContain('<');\n expect(escaped).not.toContain('>');\n expect(escaped).not.toContain('\\'');\n expect(escaped).not.toContain('/');\n expect(escaped).not.toContain('\\\"');\n\n escaped = escapeTextForBrowser('&');\n expect(escaped).toBe('&amp;');\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/escapeTextForBrowser-test\", module);\n",
"utils/__tests__/joinClasses-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\").dontMock('joinClasses');\n\nvar joinClasses = require(\"../../joinClasses\");\n\ndescribe('joinClasses', function() {\n\n it('should return a single className', function() {\n expect(joinClasses('aaa')).toEqual('aaa');\n });\n\n it('should join two classes together', function() {\n var aaa = 'aaa';\n var bbb = 'bbb';\n expect(joinClasses(aaa, bbb)).toEqual('aaa bbb');\n });\n\n it('should join many classes together', function() {\n var aaa = 'aaa';\n var bbb = 'bbb';\n var ccc = 'ccc';\n var ddd = 'ddd';\n var eee = 'eee';\n expect(joinClasses(aaa, bbb, ccc, ddd, eee)).toEqual('aaa bbb ccc ddd eee');\n });\n\n it('should omit undefined and empty classes', function() {\n var aaa = 'aaa';\n var bbb;\n var ccc = null;\n var ddd = '';\n var eee = 'eee';\n expect(joinClasses(bbb)).toEqual('');\n expect(joinClasses(bbb, bbb, bbb)).toEqual('');\n expect(joinClasses(aaa, bbb, ccc, ddd, eee)).toEqual('aaa eee');\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/joinClasses-test\", module);\n",
"utils/__tests__/keyMirror-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\").dontMock('keyMirror');\n\nvar keyMirror = require(\"../../keyMirror\");\n\ndescribe('keyMirror', function() {\n it('should create an object with values matching keys provided', function() {\n var mirror = keyMirror({\n foo: null,\n bar: true,\n \"baz\": { some: \"object\" },\n qux: undefined\n });\n expect('foo' in mirror).toBe(true);\n expect(mirror.foo).toBe('foo');\n expect('bar' in mirror).toBe(true);\n expect(mirror.bar).toBe('bar');\n expect('baz' in mirror).toBe(true);\n expect(mirror.baz).toBe('baz');\n expect('qux' in mirror).toBe(true);\n expect(mirror.qux).toBe('qux');\n });\n\n it('should not use properties from prototypes', function() {\n function Klass() {\n this.useMeToo = true;\n }\n Klass.prototype.doNotUse = true;\n var instance = new Klass();\n instance.useMe = true;\n\n var mirror = keyMirror(instance);\n\n expect('doNotUse' in mirror).toBe(false);\n expect('useMe' in mirror).toBe(true);\n expect('useMeToo' in mirror).toBe(true);\n });\n\n it('should throw when a non-object argument is used', function() {\n [null, undefined, 0, 7, ['uno'], true, \"string\"].forEach(function(testVal) {\n expect(keyMirror.bind(null, testVal)).toThrow();\n });\n });\n\n it('should work when \"constructor\" is a key', function() {\n var obj = { constructor: true };\n expect(keyMirror.bind(null, obj)).not.toThrow();\n var mirror = keyMirror(obj);\n expect('constructor' in mirror).toBe(true);\n });\n});\n\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/keyMirror-test\", module);\n",
"utils/__tests__/memoizeStringOnly-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\ndescribe('memoizeStringOnly', function() {\n var memoizeStringOnly;\n\n beforeEach(function() {\n require(\"../../mock-modules\").dumpCache();\n memoizeStringOnly = require(\"../../memoizeStringOnly\");\n });\n\n it('should be transparent to callers', function() {\n var callback = function(string) {\n return string;\n };\n var memoized = memoizeStringOnly(callback);\n\n expect(memoized('foo'), callback('foo'));\n });\n});\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/memoizeStringOnly-test\", module);\n",
"utils/__tests__/onlyChild-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n * @jsx React.DOM\n */\n\n\"use strict\";\n\ndescribe('onlyChild', function() {\n\n var React;\n var onlyChild;\n var WrapComponent;\n\n beforeEach(function() {\n React = require(\"../../React\");\n onlyChild = require(\"../../onlyChild\");\n WrapComponent = React.createClass({\n render: function() {\n return (\n React.DOM.div(null, \n onlyChild(this.props.children, this.props.mapFn, this)\n )\n );\n }\n });\n });\n\n it('should fail when passed two children', function() {\n expect(function() {\n var instance =\n WrapComponent(null, \n React.DOM.div(null ),\n React.DOM.span(null )\n );\n onlyChild(instance.props.children);\n }).toThrow();\n });\n\n it('should fail when passed nully values', function() {\n expect(function() {\n var instance =\n WrapComponent(null, \n null\n );\n onlyChild(instance.props.children);\n }).toThrow();\n\n expect(function() {\n var instance =\n WrapComponent(null, \n undefined\n );\n onlyChild(instance.props.children);\n }).toThrow();\n });\n\n it('should fail when key/value objects', function() {\n expect(function() {\n var instance =\n WrapComponent(null, \n {oneThing: React.DOM.span(null )}\n );\n onlyChild(instance.props.children);\n }).toThrow();\n });\n\n\n it('should not fail when passed interpolated single child', function() {\n expect(function() {\n var instance =\n WrapComponent(null, \n React.DOM.span(null )\n );\n onlyChild(instance.props.children);\n }).not.toThrow();\n });\n\n\n it('should return the only child', function() {\n expect(function() {\n var instance =\n WrapComponent(null, \n React.DOM.span(null )\n );\n onlyChild(instance.props.children);\n }).not.toThrow();\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/onlyChild-test\", module);\n",
"utils/__tests__/mergeFuncs-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n */\n\n\"use strict\";\n\nrequire(\"../../mock-modules\")\n .dontMock('mergeHelpers')\n .dontMock('merge')\n .dontMock('mergeDeep')\n .dontMock('mergeInto')\n .dontMock('mergeDeepInto');\n\nvar mergeHelpers;\nvar merge;\nvar mergeInto;\nvar mergeDeep;\nvar mergeDeepInto;\n\nvar isTerminal;\nvar MAX_MERGE_DEPTH;\n\n/**\n * Simple helper to traverse an object, calling the callback (cb) on every\n * nonTerminal node it finds. It stops once it reaches the maximum depth,\n * because we know that the merge functions shouldn't merge past that depth\n * anyways. If you don't \"stop\" once reaching the MAX_MERGE_DEPTH, there won't\n * be a practical way to traverse circular structures.\n */\nvar traverseUntilLeaves = function(obj, cb, depth) {\n if ((depth || 0) >= MAX_MERGE_DEPTH) {\n return;\n }\n var key;\n if (!isTerminal(obj) && !Array.isArray(obj)) {\n cb(obj);\n for (key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n traverseUntilLeaves(obj[key], cb, (depth || 0) + 1);\n }\n }\n};\n\n/*\n * Checks that the structure of two merged objects are identical. Checks\n * MAX_LEVEL because we don't want to block other unit tests if I have an\n * infinite loop.\n */\nvar MAX_LEVEL = 50;\nvar structureEquals = function(one, two, levelParam) {\n var level = levelParam || 0;\n var oneKey;\n var twoKey;\n if (level > MAX_LEVEL) {\n throw new Error('structure equals computation explored too many levels');\n }\n if (isTerminal(one) && isTerminal(two)) {\n return one === two;\n } else if (!isTerminal(one) && !isTerminal(two)) {\n var allInOneAreInTwo = true;\n for (oneKey in one) {\n if (!one.hasOwnProperty(oneKey)) {\n continue;\n }\n if (!structureEquals(one[oneKey], two[oneKey], level + 1)) {\n allInOneAreInTwo = false;\n }\n }\n var allInTwoAreInOne = true;\n for (twoKey in two) {\n if (!two.hasOwnProperty(twoKey)) {\n continue;\n }\n if (!structureEquals(two[twoKey], one[twoKey], level + 1)) {\n allInTwoAreInOne = false;\n }\n }\n // Sure, the computations overlap a bit.\n return allInOneAreInTwo && allInTwoAreInOne;\n } else {\n return false;\n }\n};\n\n\nvar makeCircular = function() {\n var obj = {};\n obj.self = obj;\n return obj;\n};\n\n\n\n/**\n * Not a symmetric function. Checks if there are any node references\n * (nonTerminal [non-string, non-null, etc]) that exist in inThis. See\n * sharesOnlyTerminalMemory.\n */\nvar hasNoNodeReferencesIn = function(obj, inThis) {\n traverseUntilLeaves(obj, function(nonTerm) {\n traverseUntilLeaves(inThis, function(inThisNonTerm) {\n if (inThisNonTerm === nonTerm) {\n return false;\n }\n });\n });\n return true;\n};\n\n/**\n * Checks that two objects share no memory references with each other (except\n * possibly at the terminal nodes (such as strings etc)). This is used to test\n * isolation of memory. When certain merge operations occur we need to ensure\n * that we did not leak references across objects.\n */\nvar sharesOnlyTerminalMemory = function(a, b) {\n return hasNoNodeReferencesIn(a, b) && hasNoNodeReferencesIn(b, a);\n};\n\n/**\n * Tests all of the merging functions. You provide it data that describes what\n * a deep merge looks like and what a shallow merge looks like. It will make\n * sure that various input/output contracts are adhered to, in addition to\n * ensuring that various guarantees about side-effects are upheld.\n * The test data must provide functions createOne/createTwo as a means to\n * create test data for objects one/two respsectively - each time these\n * functions must return pristine copies so that we can test for side effects\n * correctly.\n */\nvar testAllMerges = function(testData) {\n var createOne = testData.createOne;\n var createTwo = testData.createTwo;\n var one;\n var two;\n\n /*\n * Test merge()\n */\n one = createOne();\n two = createTwo();\n if (testData.mergeShouldThrow) {\n expect(function() {\n merge(one, two);\n }).toThrow();\n } else {\n var mergeRes = merge(one, two);\n if (testData.shallowResultShouldBe) {\n expect(structureEquals(\n mergeRes,\n testData.shallowResultShouldBe)\n ).toBe(true);\n }\n // Line truncated
"utils/__tests__/sliceChildren-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n * @jsx React.DOM\n */\n\n\"use strict\";\n\ndescribe('sliceChildren', function() {\n\n var React;\n var ReactTestUtils;\n\n var sliceChildren;\n var reactComponentExpect;\n\n var Partial;\n\n beforeEach(function() {\n React = require(\"../../React\");\n ReactTestUtils = require(\"../../ReactTestUtils\");\n\n sliceChildren = require(\"../../sliceChildren\");\n reactComponentExpect = require(\"../../reactComponentExpect\");\n\n Partial = React.createClass({\n render: function() {\n return (\n React.DOM.div(null, \n sliceChildren(\n this.props.children,\n this.props.start,\n this.props.end\n )\n )\n );\n }\n });\n });\n\n function renderAndSlice(set, start, end) {\n var instance = Partial( {start:start, end:end}, set);\n ReactTestUtils.renderIntoDocument(instance);\n var rendered = reactComponentExpect(instance)\n .expectRenderedChild()\n .instance();\n return rendered.props.children;\n }\n\n it('should render the whole set if start zero is supplied', function() {\n var fullSet = [\n React.DOM.div( {key:\"A\"} ),\n React.DOM.div( {key:\"B\"} ),\n React.DOM.div( {key:\"C\"} )\n ];\n var children = renderAndSlice(fullSet, 0);\n expect(children).toEqual({\n '{A}': fullSet[0],\n '{B}': fullSet[1],\n '{C}': fullSet[2]\n });\n });\n\n it('should render the remaining set if no end index is supplied', function() {\n var fullSet = [\n React.DOM.div( {key:\"A\"} ),\n React.DOM.div( {key:\"B\"} ),\n React.DOM.div( {key:\"C\"} )\n ];\n var children = renderAndSlice(fullSet, 1);\n expect(children).toEqual({\n '{B}': fullSet[1],\n '{C}': fullSet[2]\n });\n });\n\n it('should exclude everything at or after the end index', function() {\n var fullSet = [\n React.DOM.div( {key:\"A\"} ),\n React.DOM.div( {key:\"B\"} ),\n React.DOM.div( {key:\"C\"} ),\n React.DOM.div( {key:\"D\"} )\n ];\n var children = renderAndSlice(fullSet, 1, 2);\n expect(children).toEqual({\n '{B}': fullSet[1]\n });\n });\n\n it('should allow static children to be sliced', function() {\n var a = React.DOM.div(null );\n var b = React.DOM.div(null );\n var c = React.DOM.div(null );\n\n var instance = Partial( {start:1, end:2}, a,b,c);\n ReactTestUtils.renderIntoDocument(instance);\n var rendered = reactComponentExpect(instance)\n .expectRenderedChild()\n .instance();\n\n expect(rendered.props.children).toEqual({\n '[1]': b\n });\n });\n\n});\n\nrequire(\"../../mock-modules\").register(\"utils/__tests__/sliceChildren-test\", module);\n",
"utils/__tests__/traverseAllChildren-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @emails react-core\n * @jsx React.DOM\n */\n\n\"use strict\";\n\ndescribe('traverseAllChildren', function() {\n var traverseAllChildren;\n var React;\n beforeEach(function() {\n traverseAllChildren = require(\"../../traverseAllChildren\");\n React = require(\"../../React\");\n });\n\n\n it('should support identity for simple', function() {\n var traverseContext = [];\n var traverseFn =\n jasmine.createSpy().andCallFake(function (context, kid, key, index) {\n context.push(true);\n });\n\n var simpleKid = React.DOM.span( {key:\"simple\"} );\n\n // Jasmine doesn't provide a way to test that the fn was invoked with scope.\n var instance = React.DOM.div(null, simpleKid);\n traverseAllChildren(instance.props.children, traverseFn, traverseContext);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n simpleKid,\n '{simple}',\n 0\n );\n expect(traverseContext.length).toEqual(1);\n });\n\n it('should treat single arrayless child as being in array', function() {\n var traverseContext = [];\n var traverseFn =\n jasmine.createSpy().andCallFake(function (context, kid, key, index) {\n context.push(true);\n });\n\n var simpleKid = React.DOM.span(null );\n var instance = React.DOM.div(null, simpleKid);\n traverseAllChildren(instance.props.children, traverseFn, traverseContext);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n simpleKid,\n '[0]',\n 0\n );\n expect(traverseContext.length).toEqual(1);\n });\n\n it('should treat single child in array as expected', function() {\n var traverseContext = [];\n var traverseFn =\n jasmine.createSpy().andCallFake(function (context, kid, key, index) {\n context.push(true);\n });\n\n var simpleKid = React.DOM.span(null );\n var instance = React.DOM.div(null, [simpleKid]);\n traverseAllChildren(instance.props.children, traverseFn, traverseContext);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n simpleKid,\n '[0]',\n 0\n );\n expect(traverseContext.length).toEqual(1);\n });\n\n it('should be called for each child', function() {\n var zero = React.DOM.div( {key:\"keyZero\"} );\n var one = null;\n var two = React.DOM.div( {key:\"keyTwo\"} );\n var three = null;\n var four = React.DOM.div( {key:\"keyFour\"} );\n\n var traverseContext = [];\n var traverseFn =\n jasmine.createSpy().andCallFake(function (context, kid, key, index) {\n context.push(true);\n });\n\n var instance = (\n React.DOM.div(null, \n zero,\n one,\n two,\n three,\n four\n )\n );\n\n traverseAllChildren(instance.props.children, traverseFn, traverseContext);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n zero,\n '{keyZero}',\n 0\n );\n expect(traverseFn).toHaveBeenCalledWith(traverseContext, one, '[1]', 1);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n two,\n '{keyTwo}',\n 2\n );\n expect(traverseFn).toHaveBeenCalledWith(traverseContext, three, '[3]', 3);\n expect(traverseFn).toHaveBeenCalledWith(\n traverseContext,\n four,\n '{keyFour}',\n 4\n );\n });\n\n // Todo: test that nums/strings are converted to ReactComponents.\n\n it('should be called for each child in nested structure', function() {\n var zero = React.DOM.div( {key:\"keyZero\"} );\n var one = null;\n var two = React.DOM.div( {key:\"keyTwo\"} );\n var three = null;\n var four = React.DOM.div( {key:\"keyFour\"} );\n var five = React.DOM.div( {key:\"keyFiveCompletelyIgnored\"} );\n // Name precedence is as follows:\n // 1. JavaScript Object key if in a JavaScript object:\n // 2. If grouped in an Array, the `key` attribute.\n // 3. The array index if in a JavaScript Array.\n\n\n var traverseContext = [];\n var traverseFn =\n jasmine.createSpy().andCallFake(function (context, kid, key, index) {\n context.push(true);\n });\n\n var instance = (\n React.DOM.div(null, \n [{\n firstHalfKey: [zero, one, two],\n secondHalfKey: [three, four],\n keyFive: five\n }]\n )\n Line truncated
"vendor/error/__tests__/erx-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @emails catchen@fb.com\n * @emails javascript@lists.facebook.com\n */\n\nrequire(\"../../../mock-modules\")\n .dontMock('erx')\n .dontMock('ex');\n\ndescribe('erx', function() {\n var erx = require(\"../../../erx\");\n var ex = require(\"../../../ex\");\n\n it('should always reverse ex if placeholder and argument match', function() {\n expect(erx(ex('zero argument'))).toEqual(['zero argument']);\n expect(erx(ex('one argument: %s', 'one')))\n .toEqual(['one argument: %s', 'one']);\n expect(erx(ex('two arguments: %s, %s', 'one', 2)))\n .toEqual(['two arguments: %s, %s', 'one', '2']);\n expect(erx(ex('three arguments: %s, %s, %s', 'one', 2, { value: 3 })))\n .toEqual(['three arguments: %s, %s, %s', 'one', '2', '[object Object]']);\n });\n\n it('should be idempotent', function() {\n var messageWithParams = erx(ex('one argument: %s', 'one'));\n expect(messageWithParams).toEqual(erx(messageWithParams));\n });\n\n it('should treat plain text as it was ex-ed with no argument', function() {\n expect(erx('plain text')).toEqual(['plain text']);\n });\n\n it('should work when text was appended/prepended to ex-ed text', function() {\n expect(erx('prepended text|' + ex('zero argument') + '|appended text'))\n .toEqual(['prepended text|zero argument|appended text']);\n expect(erx(\n 'prepended text|' +\n ex('one argument: %s', 'one') +\n '|appended text'\n )).toEqual(['prepended text|one argument: %s|appended text', 'one']);\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"vendor/error/__tests__/erx-test\", module);\n",
"vendor/error/__tests__/ex-test":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @emails catchen@fb.com\n * @emails javascript@lists.facebook.com\n */\n\nrequire(\"../../../mock-modules\")\n .dontMock('ex');\n\ndescribe('ex', function() {\n var ex = require(\"../../../ex\");\n\n it('should convert whatever arguments into one string', function() {\n expect(typeof ex('zero argument')).toEqual('string');\n expect(typeof ex('one argument: %s', 'one')).toEqual('string');\n expect(typeof ex('two arguments: %s, %s', 'one', 2))\n .toEqual('string');\n expect(typeof ex('three arguments: %s, %s, %s', 'one', 2, { value: 3 }))\n .toEqual('string');\n });\n\n it('should handle placeholder and argument number mismatch', function() {\n expect(typeof ex('zero placeholder and one argument', 'one'))\n .toEqual('string');\n expect(typeof ex('one placeholder and zero argument: %s'))\n .toEqual('string');\n });\n});\n\nrequire(\"../../../mock-modules\").register(\"vendor/error/__tests__/ex-test\", module);\n",
"test/phantomjs-shims":"(function() {\n\nvar Ap = Array.prototype;\nvar slice = Ap.slice;\nvar Fp = Function.prototype;\n\nif (!Fp.bind) {\n // PhantomJS doesn't support Function.prototype.bind natively, so\n // polyfill it whenever this module is required.\n Fp.bind = function(context) {\n var func = this;\n var args = slice.call(arguments, 1);\n\n function bound() {\n var invokedAsConstructor = func.prototype && (this instanceof func);\n return func.apply(\n // Ignore the context parameter when invoking the bound function\n // as a constructor. Note that this includes not only constructor\n // invocations using the new keyword but also calls to base class\n // constructors such as BaseClass.call(this, ...) or super(...).\n !invokedAsConstructor && context || this,\n args.concat(slice.call(arguments))\n );\n }\n\n // The bound function must share the .prototype of the unbound\n // function so that any object created by one constructor will count\n // as an instance of both constructors.\n bound.prototype = func.prototype;\n\n return bound;\n };\n}\n\n})();\n\nrequire(\"../mock-modules\").register(\"test/phantomjs-shims\", module);\n",
"ReactTestUtils":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactTestUtils\n */\n\nvar EventConstants = require(\"./EventConstants\");\nvar React = require(\"./React\");\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactTextComponent = require(\"./ReactTextComponent\");\nvar ReactMount = require(\"./ReactMount\");\n\nvar mergeInto = require(\"./mergeInto\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nfunction Event(suffix) {}\n\n/**\n * @class ReactTestUtils\n */\n\n/**\n * Todo: Support the entire DOM.scry query syntax. For now, these simple\n * utilities will suffice for testing purposes.\n * @lends ReactTestUtils\n */\nvar ReactTestUtils = {\n renderIntoDocument: function(instance) {\n var div = document.createElement('div');\n document.documentElement.appendChild(div);\n return React.renderComponent(instance, div);\n },\n\n isComponentOfType: function(inst, type) {\n return !!(\n inst &&\n ReactComponent.isValidComponent(inst) &&\n inst.constructor === type.componentConstructor\n );\n },\n\n isDOMComponent: function(inst) {\n return !!(inst &&\n ReactComponent.isValidComponent(inst) &&\n !!inst.tagName);\n },\n\n isCompositeComponent: function(inst) {\n return !!(\n inst &&\n ReactComponent.isValidComponent(inst) &&\n typeof inst.render === 'function' &&\n typeof inst.setState === 'function' &&\n typeof inst.updateComponent === 'function'\n );\n },\n\n isCompositeComponentWithType: function(inst, type) {\n return !!(ReactTestUtils.isCompositeComponent(inst) &&\n (inst.constructor === type.componentConstructor ||\n inst.constructor === type));\n },\n\n isTextComponent: function(inst) {\n return inst instanceof ReactTextComponent;\n },\n\n findAllInRenderedTree: function(inst, test) {\n if (!inst) {\n return [];\n }\n var ret = test(inst) ? [inst] : [];\n if (ReactTestUtils.isDOMComponent(inst)) {\n var renderedChildren = inst._renderedChildren;\n var key;\n for (key in renderedChildren) {\n if (!renderedChildren.hasOwnProperty(key)) {\n continue;\n }\n ret = ret.concat(\n ReactTestUtils.findAllInRenderedTree(renderedChildren[key], test)\n );\n }\n } else if (ReactTestUtils.isCompositeComponent(inst)) {\n ret = ret.concat(\n ReactTestUtils.findAllInRenderedTree(inst._renderedComponent, test)\n );\n }\n return ret;\n },\n\n /**\n * Finds all instance of components in the rendered tree that are DOM\n * components with the class name matching `className`.\n * @return an array of all the matches.\n */\n scryRenderedDOMComponentsWithClass: function(root, className) {\n return ReactTestUtils.findAllInRenderedTree(root, function(inst) {\n var instClassName = inst.props.className;\n return ReactTestUtils.isDOMComponent(inst) && (\n instClassName &&\n (' ' + instClassName + ' ').indexOf(' ' + className + ' ') !== -1\n );\n });\n },\n\n /**\n * Like scryRenderedDOMComponentsWithClass but expects there to be one result,\n * and returns that one result, or throws exception if there is any other\n * number of matches besides one.\n * @return {!ReactDOMComponent} The one match.\n */\n findRenderedDOMComponentWithClass: function(root, className) {\n var all =\n ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);\n if (all.length !== 1) {\n throw new Error('Did not find exactly one match for class:' + className);\n }\n return all[0];\n },\n\n\n /**\n * Finds all instance of components in the rendered tree that are DOM\n * components with the tag name matching `tagName`.\n * @return an array of all the matches.\n */\n scryRenderedDOMComponentsWithTag: function(root, tagName) {\n return ReactTestUtils.findAllInRenderedTree(root, function(inst) {\n return ReactTestUtils.isDOMComponent(inst) &&\n inst.tagName === tagName.toUpperCase();\n });\n },\n\n /**\n * Like scryRenderedDOMComponentsWithTag but expects there to be one result,\n * and returns that one result, or throws exception if there is any other\n * number of matches besides one.\n * @return {!ReactDOMComponent} The one match.\Line truncated
"reactComponentExpect":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule reactComponentExpect\n * @nolint\n */\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactTestUtils = require(\"./ReactTestUtils\");\n\nvar mergeInto = require(\"./mergeInto\");\n\nfunction reactComponentExpect(instance) {\n if (instance instanceof reactComponentExpect) {\n return instance;\n }\n\n if (!(this instanceof reactComponentExpect)) {\n return new reactComponentExpect(instance);\n }\n\n this._instance = instance;\n this.toBeValidReactComponent();\n}\n\nmergeInto(reactComponentExpect.prototype, {\n // Getters -------------------------------------------------------------------\n\n /**\n * @instance: Retrieves the backing instance.\n */\n instance: function() {\n return this._instance;\n },\n\n /**\n * There are two types of components in the world.\n * - A component created via React.createClass() - Has a single child\n * subComponent - the return value from the .render() function. This\n * function @subComponent expects that this._instance is component created\n * with React.createClass().\n * - A primitive DOM component - which has many renderedChildren, each of\n * which may have a name that is unique with respect to its siblings. This\n * method will fail if this._instance is a primitive component.\n *\n * TL;DR: An instance may have a subComponent (this._renderedComponent) or\n * renderedChildren, but never both. Neither will actually show up until you\n * render the component (simply instantiating is not enough).\n */\n expectRenderedChild: function() {\n this.toBeCompositeComponent();\n return new reactComponentExpect(this.instance()._renderedComponent);\n },\n\n /**\n * The nth child of a DOMish component instance that is not falsy.\n */\n expectRenderedChildAt: function(childIndex) {\n // Currently only dom components have arrays of children, but that will\n // change soon.\n this.toBeDOMComponent();\n var renderedChildren = this.instance()._renderedChildren || {};\n var nonEmptyCount = 0;\n var name;\n for (name in renderedChildren) {\n if (!renderedChildren.hasOwnProperty(name)) {\n continue;\n }\n if (renderedChildren[name]) {\n if (nonEmptyCount === childIndex) {\n return new reactComponentExpect(renderedChildren[name]);\n }\n nonEmptyCount++;\n }\n }\n throw new Error('Child:' + childIndex + ' is not found');\n },\n\n toBeDOMComponentWithChildCount: function(n) {\n this.toBeDOMComponent();\n expect(this.instance()._renderedChildren).toBeTruthy();\n var len = Object.keys(this.instance()._renderedChildren).length;\n expect(len).toBe(n);\n return this;\n },\n\n toBeDOMComponentWithNoChildren: function() {\n this.toBeDOMComponent();\n expect(this.instance()._renderedChildren).toBeFalsy();\n return this;\n },\n\n // Matchers ------------------------------------------------------------------\n\n toBeComponentOfType: function(convenienceConstructor) {\n expect(ReactTestUtils.isComponentOfType(\n this.instance(),\n convenienceConstructor\n )).toBe(true);\n return this;\n },\n\n /**\n * A component that is created with React.createClass. Just duck typing\n * here.\n */\n toBeCompositeComponent: function() {\n this.toBeValidReactComponent();\n expect(ReactTestUtils.isCompositeComponent(this.instance())).toBe(true);\n return this;\n },\n\n toBeCompositeComponentWithType: function(convenienceConstructor) {\n expect(ReactTestUtils.isCompositeComponentWithType(\n this.instance(),\n convenienceConstructor\n )).toBe(true);\n return this;\n },\n\n toBeTextComponent: function() {\n expect(ReactTestUtils.isTextComponent(this.instance())).toBe(true);\n return this;\n },\n\n /**\n * Falsy values are valid components - the vanished component that is.\n */\n toBeValidReactComponent: function() {\n expect(ReactComponent.isValidComponent(this.instance())).toBe(true);\n return this;\n },\n\n toBePresent: function() {\n expect(this.instance()).toBeTruthy();\n return this;\n },\n\n /**\n * A terminal type of component representing some virtual dom node. Just duck\n * typing here.\n */\n toBeDOMComponent: function() {\n expect(ReactTestUtils.isDOMComponent(this.instance())). Line truncated
"mocks":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mocks\n */\n\nfunction isA(typeName, value) {\n return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';\n}\n\nfunction getType(ref) {\n if (isA('RegExp', ref)) {\n return 'regexp';\n }\n\n if (isA('Array', ref)) {\n return 'array';\n }\n\n if (isA('Function', ref)) {\n return 'function';\n }\n\n if (isA('Object', ref)) {\n return 'object';\n }\n\n // consider number and string fields to be constants that we want to\n // pick up as they are\n if (isA('Number', ref) || isA('String', ref)) {\n return 'constant';\n }\n\n return null;\n}\n\nfunction makeComponent(metadata) {\n switch (metadata.type) {\n case 'object':\n return {};\n\n case 'array':\n return [];\n\n case 'regexp':\n return new RegExp();\n\n case 'constant':\n return metadata.value;\n\n case 'function':\n var defaultReturnValue;\n var specificReturnValues = [];\n var mockImpl;\n var isReturnValueLastSet = false;\n var calls = [];\n var instances = [];\n var prototype =\n (metadata.members && metadata.members.prototype &&\n metadata.members.prototype.members) || {};\n\n var f = function() {\n global.dirtyMocks.push(f);\n\n instances.push(this);\n calls.push(Array.prototype.slice.call(arguments));\n if (this instanceof arguments.callee) {\n // This is probably being called as a constructor\n for (var slot in prototype) {\n // Copy prototype methods to the instance to make\n // it easier to interact with mock instance call and\n // return values\n if (prototype[slot].type == 'function') {\n var protoImpl = this[slot];\n this[slot] = generateFromMetadata(prototype[slot]);\n this[slot]._protoImpl = protoImpl;\n }\n }\n\n // Run the mock constructor implementation\n mockImpl && mockImpl.apply(this, arguments);\n return;\n }\n\n var returnValue;\n // If return value is last set, either specific or default, i.e.\n // mockReturnValue()/mockDefaultReturnValue() is called and no\n // mockImplementation() is called after that.\n // use the set return value.\n if (isReturnValueLastSet) {\n returnValue = specificReturnValues.shift();\n if (returnValue === undefined) {\n returnValue = defaultReturnValue;\n }\n }\n\n // If mockImplementation() is last set, or specific return values\n // are used up, use the mock implementation.\n if (mockImpl && returnValue === undefined) {\n return mockImpl.apply(this, arguments);\n }\n\n // Otherwise use prototype implementation\n if (returnValue === undefined && arguments.callee._protoImpl) {\n return arguments.callee._protoImpl.apply(this, arguments);\n }\n\n return returnValue;\n };\n\n f._isMockFunction = true;\n\n f.mock = {\n calls : calls,\n instances : instances\n };\n\n f.mockClear = function() {\n calls.length = 0;\n instances.length = 0;\n };\n\n f.mockReturnValue = function(value) {\n // next function call will return this value or default return value\n isReturnValueLastSet = true;\n specificReturnValues.push(value);\n return f;\n };\n\n f.mockDefaultReturnValue = function(value) {\n // next function call will return specified return value or this one\n isReturnValueLastSet = true;\n defaultReturnValue = value;\n return f;\n };\n\n f.mockImplementation = function(fn) {\n // next function call will use mock implementation return value\n isReturnValueLastSet = false;\n mockImpl = fn;\n return f;\n };\n\n f.mockReturnThis = function() {\n return f.mockImplementation(function() {\n return this;\n });\n };\n\n f._getMockImplementation = function() {\n return mockImpl;\n };\n\n if (metadata.mockImpl) {\n f.mockImplementation(metadata.mockImpl);\n }\n\n return f;\n }\n\n throw new Error('Unrecognized type ' + metadata.type);\n}\n\nfunction generateFromMetadata(_metadata) { Line truncated
"mock-modules":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mock-modules\n */\n\nvar mocks = require(\"./mocks\");\nvar exportsRegistry = {};\nvar hasOwn = exportsRegistry.hasOwnProperty;\nvar explicitMockMap = {};\n\nfunction getMock(exports) {\n try {\n return mocks.generateFromMetadata(mocks.getMetadata(exports));\n } catch (err) {\n console.warn(err);\n return exports;\n }\n}\n\n// This function should be called at the bottom of any module that might\n// need to be mocked, after the final value of module.exports is known.\nexports.register = function(id, module) {\n exportsRegistry[id] = {\n module: module,\n actual: module.exports,\n mocked: null // Filled in lazily later.\n };\n\n // If doMock or doNotMock was called earlier, before the module was\n // registered, then the choice should have been recorded in\n // explicitMockMap. Now that the module is registered, we can finally\n // fulfill the request.\n if (hasOwn.call(explicitMockMap, id)) {\n if (explicitMockMap[id]) {\n doMock(id);\n } else {\n doNotMock(id);\n }\n }\n\n return exports;\n};\n\nfunction resetEntry(id) {\n if (hasOwn.call(exportsRegistry, id)) {\n delete exportsRegistry[id].module.exports;\n delete exportsRegistry[id];\n }\n}\n\nexports.dumpCache = function() {\n require(\"./mocks\").clear();\n\n // Deleting module.exports will cause the module to be lazily\n // reevaluated the next time it is required.\n for (var id in exportsRegistry) {\n resetEntry(id);\n }\n\n return exports;\n};\n\n// Call this function to ensure that require(id) returns the actual\n// exports object created by the module.\nfunction doNotMock(id) {\n explicitMockMap[id] = false;\n\n var entry = exportsRegistry[id];\n if (entry && entry.module && entry.actual) {\n entry.module.exports = entry.actual;\n }\n\n return exports;\n}\n\n// Call this function to ensure that require(id) returns a mock exports\n// object based on the actual exports object created by the module.\nfunction doMock(id) {\n explicitMockMap[id] = true;\n\n var entry = exportsRegistry[id];\n if (entry && entry.module && entry.actual) {\n // Because mocking can be expensive, create the mock exports object on\n // demand, the first time doMock is called.\n entry.mocked || (entry.mocked = getMock(entry.actual));\n entry.module.exports = entry.mocked;\n }\n\n return exports;\n}\n\nvar global = Function(\"return this\")();\nrequire(\"./test/mock-timers\").installMockTimers(global);\n\n// Exported names are different for backwards compatibility.\nexports.dontMock = doNotMock;\nexports.mock = doMock;\n",
"test/mock-timers":"var mocks = require(\"../mocks\");\n\nvar timers = {};\n// Keep a fake timestamp\n// move on the time when runTimersToTime() is called\nvar now = 0;\n\n// add a timer of type either 'timeout' or 'interval'\nfunction _setTimer(type, callback, delay) {\n var token = null;\n do {\n token = Math.floor(Math.random() * 4294967296) + 1;\n } while (timers[token]);\n timers[token] = {\n type: type,\n callback: callback,\n // Add some random msecs to the delay to mimic code execution time.\n time: now + delay + Math.floor(Math.random() * 5),\n interval: (type == 'interval' ? delay : 0)\n };\n return token;\n}\n\n// clear a timer of type either 'timeout' or 'interval'\nfunction _clearTimer(type, token) {\n if (timers[token] && timers[token].type == type) {\n delete timers[token];\n }\n}\n\nfunction _setTimeout(callback, delay) {\n return _setTimer('timeout', callback, delay);\n}\n\nfunction _setInterval(callback, delay) {\n return _setTimer('interval', callback, delay);\n}\n\nfunction _clearTimeout(token) {\n _clearTimer('timeout', token);\n}\n\nfunction _clearInterval(token) {\n _clearTimer('interval', token);\n}\n\n// Run timer of given token\nfunction _runTimer(token) {\n // Skip non-existing token\n if (timers[token]) {\n if (timers[token].type == 'timeout') {\n // for 'timeout', run callback and delete the timer\n var callback = timers[token].callback;\n delete timers[token];\n callback();\n } else if (timers[token].type == 'interval') {\n // for 'interval', run callback and set the next invoke time\n // Add some random msecs to the delay to mimic code execution time.\n timers[token].time =\n now + timers[token].interval + Math.floor(Math.random() * 5);\n timers[token].callback();\n }\n }\n}\n\nfunction _runTimersOnce() {\n // Invoke all timers once regardsless of the delay\n for (var token in timers) {\n _runTimer(token);\n }\n}\n\nfunction _runTimersToTime(delay) {\n var toRunToken = _getNextTimerToken();\n if (!toRunToken) {\n return;\n }\n\n var minTime = timers[toRunToken].time;\n if (now + delay < minTime) {\n // Termination when there's no more timers to invoke\n now += delay;\n } else {\n // Recursively invoke the next to-run timer\n delay -= (minTime - now);\n now = minTime;\n _runTimer(toRunToken);\n _runTimersToTime(delay);\n }\n}\n\nfunction _runTimersRepeatedly() {\n // Only run a generous 1000 timers and then bail, since we may have entered\n // a loop if we have more than that.\n var max_timers = 1000;\n\n var token;\n for (var ii = 0; ii < max_timers; ii++) {\n token = _getNextTimerToken();\n\n if (!token) {\n break;\n }\n\n _runTimer(token);\n }\n\n if (ii === max_timers) {\n throw new Error(\"More timers still exist after \" + max_timers + \" timers!\");\n }\n}\n\nfunction _clearTimers() {\n for (var token in timers) {\n delete timers[token];\n }\n}\n\nfunction _getNextTimerToken() {\n var nextTimerToken = null;\n var minTime = 31536000000; // One year\n // Find the next to invoke timer\n for (var token in timers) {\n if (timers[token].time < minTime) {\n nextTimerToken = token;\n minTime = timers[token].time;\n }\n }\n return nextTimerToken;\n}\n\nvar mockTimers = {\n setTimeout: _setTimeout,\n clearTimeout: _clearTimeout,\n setInterval: _setInterval,\n clearInterval: _clearInterval,\n\n /**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Iteratively run callbacks in time order during the time from now to\n * now + delay.\n * If one callback register another timer which should be run during now to\n * now + delay, the new timer will also be run in the right order.\n *\n * @param delay\n */\n runTimersToTime: _runTimersToTime,\n\n /**\n * Run all registered timer once. Newly registered timers will not be run.\n */\n runTimersOnce: _runTimersOnce,\n\n /**\n * Iteratively run callbacks until there are no timers left to call. Will\n * stop after a maximum number of iterations to avoid infinite loop.\n *\n * @param maximum iterations (optional)\n */\n runTimersRepeatedly: _runTimersRepeatedly,\n\n /**\n * Clear all timers\n */\n clearTimers: _clearTimers,\n\n /**\n * Get the number of remaining timers\n */\n getTimersCount: function() {\n return Object.keys(timers).length;\n }\n};\n\nmodule.eLine truncated
"LinkedStateMixin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule LinkedStateMixin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactLink = require(\"./ReactLink\");\nvar ReactStateSetters = require(\"./ReactStateSetters\");\n\n/**\n * A simple mixin around ReactLink.forState().\n */\nvar LinkedStateMixin = {\n /**\n * Create a ReactLink that's linked to part of this component's state. The\n * ReactLink will have the current value of this.state[key] and will call\n * setState() when a change is requested.\n *\n * @param {string} key state key to update. Note: you may want to use keyOf()\n * if you're using Google Closure Compiler advanced mode.\n * @return {ReactLink} ReactLink instance linking to the state.\n */\n linkState: function(key) {\n return new ReactLink(\n this.state[key],\n ReactStateSetters.createStateKeySetter(this, key)\n );\n }\n};\n\nmodule.exports = LinkedStateMixin;\n\nrequire(\"./mock-modules\").register(\"LinkedStateMixin\", module);\n",
"React":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule React\n */\n\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactCurrentOwner = require(\"./ReactCurrentOwner\");\nvar ReactDOM = require(\"./ReactDOM\");\nvar ReactDOMComponent = require(\"./ReactDOMComponent\");\nvar ReactDefaultInjection = require(\"./ReactDefaultInjection\");\nvar ReactInstanceHandles = require(\"./ReactInstanceHandles\");\nvar ReactMount = require(\"./ReactMount\");\nvar ReactMultiChild = require(\"./ReactMultiChild\");\nvar ReactPerf = require(\"./ReactPerf\");\nvar ReactPropTypes = require(\"./ReactPropTypes\");\nvar ReactServerRendering = require(\"./ReactServerRendering\");\nvar ReactTextComponent = require(\"./ReactTextComponent\");\n\nReactDefaultInjection.inject();\n\nvar React = {\n DOM: ReactDOM,\n PropTypes: ReactPropTypes,\n initializeTouchEvents: function(shouldUseTouch) {\n ReactMount.useTouchEvents = shouldUseTouch;\n },\n createClass: ReactCompositeComponent.createClass,\n constructAndRenderComponent: ReactMount.constructAndRenderComponent,\n constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,\n renderComponent: ReactPerf.measure(\n 'React',\n 'renderComponent',\n ReactMount.renderComponent\n ),\n renderComponentToString: ReactServerRendering.renderComponentToString,\n unmountComponentAtNode: ReactMount.unmountComponentAtNode,\n unmountAndReleaseReactRootNode: ReactMount.unmountAndReleaseReactRootNode,\n isValidClass: ReactCompositeComponent.isValidClass,\n isValidComponent: ReactComponent.isValidComponent,\n __internals: {\n Component: ReactComponent,\n CurrentOwner: ReactCurrentOwner,\n DOMComponent: ReactDOMComponent,\n InstanceHandles: ReactInstanceHandles,\n Mount: ReactMount,\n MultiChild: ReactMultiChild,\n TextComponent: ReactTextComponent\n }\n};\n\n// Version exists only in the open-source version of React, not in Facebook's\n// internal version.\nReact.version = '0.6.0-alpha';\n\nmodule.exports = React;\n\nrequire(\"./mock-modules\").register(\"React\", module);\n",
"ReactLink":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactLink\n * @typechecks static-only\n */\n\n\"use strict\";\n\n/**\n * ReactLink encapsulates a common pattern in which a component wants to modify\n * a prop received from its parent. ReactLink allows the parent to pass down a\n * value coupled with a callback that, when invoked, expresses an intent to\n * modify that value. For example:\n *\n * React.createClass({\n * getInitialState: function() {\n * return {value: ''};\n * },\n * render: function() {\n * var valueLink = new ReactLink(this.state.value, this._handleValueChange);\n * return <input valueLink={valueLink} />;\n * },\n * this._handleValueChange: function(newValue) {\n * this.setState({value: newValue});\n * }\n * });\n *\n * We have provided some sugary mixins to make the creation and\n * consumption of ReactLink easier; see LinkedValueMixin and LinkedStateMixin.\n */\n\n/**\n * @param {*} value current value of the link\n * @param {function} requestChange callback to request a change\n */\nfunction ReactLink(value, requestChange) {\n this.value = value;\n this.requestChange = requestChange;\n}\n\nmodule.exports = ReactLink;\n\nrequire(\"./mock-modules\").register(\"ReactLink\", module);\n",
"ReactTransitionGroup":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactTransitionGroup\n */\n\n\"use strict\";\n\nvar React = require(\"./React\");\nvar ReactTransitionableChild = require(\"./ReactTransitionableChild\");\nvar ReactTransitionKeySet = require(\"./ReactTransitionKeySet\");\n\nvar invariant = require(\"./invariant\");\n\nvar ReactTransitionGroupMixin = {\n componentWillMount: function() {\n // _transitionGroupCurrentKeys stores the union of previous *and* next keys.\n // If this were a component we'd store it as state, however, since this must\n // be a mixin, we need to keep the result of the union of keys in each\n // call to animateChildren() which happens in render(), so we can't\n // call setState() in there.\n this._transitionGroupCurrentKeys = {};\n },\n\n /**\n * Render some children in a transitionable way.\n */\n renderTransitionableChildren: function(sourceChildren) {\n invariant(\n this.getTransitionConfig,\n 'renderTransitionableChildren(): You must provide a ' +\n 'getTransitionConfig() method.'\n );\n\n var children = {};\n var childMapping = ReactTransitionKeySet.getChildMapping(sourceChildren);\n var transitionConfig = this.getTransitionConfig();\n var currentKeys = ReactTransitionKeySet.mergeKeySets(\n this._transitionGroupCurrentKeys,\n ReactTransitionKeySet.getKeySet(sourceChildren)\n );\n\n for (var key in currentKeys) {\n // Here is how we keep the nodes in the DOM. ReactTransitionableChild\n // knows how to hold onto its child if it changes to undefined. Here, we\n // may look up an old key in the new children, and it may switch to\n // undefined. React's reconciler will keep the ReactTransitionableChild\n // instance alive such that we can animate it.\n if (childMapping[key] || transitionConfig.leave) {\n children[key] = ReactTransitionableChild({\n name: transitionConfig.name,\n enter: transitionConfig.enter,\n onDoneLeaving: this._handleDoneLeaving.bind(this, key)\n }, childMapping[key]);\n }\n }\n\n this._transitionGroupCurrentKeys = currentKeys;\n\n return children;\n },\n\n _handleDoneLeaving: function(key) {\n // When the leave animation finishes, we should blow away the actual DOM\n // node.\n delete this._transitionGroupCurrentKeys[key];\n this.forceUpdate();\n }\n};\n\nvar ReactTransitionGroup = React.createClass({\n mixins: [ReactTransitionGroupMixin],\n\n getDefaultProps: function() {\n return {\n transitionEnter: true,\n transitionLeave: true,\n component: React.DOM.span\n };\n },\n\n getTransitionConfig: function() {\n return {\n name: this.props.transitionName,\n enter: this.props.transitionEnter,\n leave: this.props.transitionLeave\n };\n },\n\n render: function() {\n return this.transferPropsTo(\n this.props.component(\n {\n transitionName: null,\n transitionEnter: null,\n transitionLeave: null,\n component: null\n },\n this.renderTransitionableChildren(this.props.children)\n )\n );\n }\n});\n\nmodule.exports = ReactTransitionGroup;\n\nrequire(\"./mock-modules\").register(\"ReactTransitionGroup\", module);\n",
"ReactTransitionKeySet":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @typechecks static-only\n * @providesModule ReactTransitionKeySet\n */\n\n\"use strict\";\n\nvar ReactChildren = require(\"./ReactChildren\");\n\nvar MERGE_KEY_SETS_TAIL_SENTINEL = {};\n\nvar ReactTransitionKeySet = {\n /**\n * Given `this.props.children`, return an object mapping key to child. Just\n * simple syntactic sugar around ReactChildren.map().\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n getChildMapping: function(children) {\n return ReactChildren.map(children, function(child) {\n return child;\n });\n },\n\n /**\n * Simple syntactic sugar to get an object with keys of all of `children`.\n * Does not have references to the children themselves.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to the value \"true\"\n */\n getKeySet: function(children) {\n return ReactChildren.map(children, function() {\n return true;\n });\n },\n\n /**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want ot show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev child keys as returned from\n * `ReactTransitionKeySet.getKeySet()`.\n * @param {object} next next child keys as returned from\n * `ReactTransitionKeySet.getKeySet()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n mergeKeySets: function(prev, next) {\n var keySet = {};\n var prevKeys = Object.keys(prev).concat([MERGE_KEY_SETS_TAIL_SENTINEL]);\n var nextKeys = Object.keys(next).concat([MERGE_KEY_SETS_TAIL_SENTINEL]);\n var i;\n for (i = 0; i < prevKeys.length - 1; i++) {\n var prevKey = prevKeys[i];\n if (next[prevKey]) {\n continue;\n }\n\n // This key is not in the new set. Place it in our\n // best guess where it should go. We do this by searching\n // for a key after the current one in prevKeys that is\n // still in nextKeys, and inserting right before it.\n // I know this is O(n^2), but this is not a particularly\n // hot code path.\n var insertPos = -1;\n\n for (var j = i + 1; j < prevKeys.length; j++) {\n insertPos = nextKeys.indexOf(prevKeys[j]);\n if (insertPos >= 0) {\n break;\n }\n }\n\n // Insert before insertPos\n nextKeys.splice(insertPos, 0, prevKey);\n }\n\n for (i = 0; i < nextKeys.length - 1; i++) {\n keySet[nextKeys[i]] = true;\n }\n\n return keySet;\n }\n};\n\nmodule.exports = ReactTransitionKeySet;\n\nrequire(\"./mock-modules\").register(\"ReactTransitionKeySet\", module);\n",
"ReactTransitionableChild":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactTransitionableChild\n */\n\n\"use strict\";\n\nvar React = require(\"./React\");\nvar CSSCore = require(\"./CSSCore\");\nvar ReactTransitionEvents = require(\"./ReactTransitionEvents\");\n\n// We don't remove the element from the DOM until we receive an animationend or\n// transitionend event. If the user screws up and forgets to add an animation\n// their node will be stuck in the DOM forever, so we detect if an animation\n// does not start and if it doesn't, we just call the end listener immediately.\nvar TICK = 17;\nvar NO_EVENT_TIMEOUT = 5000;\n\nvar noEventListener = null;\n\nif (true) {\n noEventListener = function() {\n console.warn(\n 'transition(): tried to perform an animation without ' +\n 'an animationend or transitionend event after timeout (' +\n NO_EVENT_TIMEOUT + 'ms). You should either disable this ' +\n 'transition in JS or add a CSS animation/transition.'\n );\n };\n}\n\n/**\n * This component is simply responsible for watching when its single child\n * changes to undefined and animating the old child out. It does this by\n * recording its old child in savedChildren when it detects this event is about\n * to occur.\n */\nvar ReactTransitionableChild = React.createClass({\n /**\n * Perform an actual DOM transition. This takes care of a few things:\n * - Adding the second CSS class to trigger the transition\n * - Listening for the finish event\n * - Cleaning up the css (unless noReset is true)\n */\n transition: function(animationType, noReset, finishCallback) {\n var node = this.getDOMNode();\n var className = this.props.name + '-' + animationType;\n var activeClassName = className + '-active';\n var noEventTimeout = null;\n\n var endListener = function() {\n if (true) {\n clearTimeout(noEventTimeout);\n }\n\n // If this gets invoked after the component is unmounted it's OK.\n if (!noReset) {\n // Usually this means you're about to remove the node if you want to\n // leave it in its animated state.\n CSSCore.removeClass(node, className);\n CSSCore.removeClass(node, activeClassName);\n }\n\n ReactTransitionEvents.removeEndEventListener(node, endListener);\n\n // Usually this optional callback is used for informing an owner of\n // a leave animation and telling it to remove the child.\n finishCallback && finishCallback();\n };\n\n ReactTransitionEvents.addEndEventListener(node, endListener);\n\n CSSCore.addClass(node, className);\n\n // Need to do this to actually trigger a transition.\n this.queueClass(activeClassName);\n\n if (true) {\n noEventTimeout = setTimeout(noEventListener, NO_EVENT_TIMEOUT);\n }\n },\n\n queueClass: function(className) {\n this.classNameQueue.push(className);\n\n if (this.props.runNextTick) {\n this.props.runNextTick(this.flushClassNameQueue);\n return;\n }\n\n if (!this.timeout) {\n this.timeout = setTimeout(this.flushClassNameQueue, TICK);\n }\n },\n\n flushClassNameQueue: function() {\n if (this.isMounted()) {\n this.classNameQueue.forEach(\n CSSCore.addClass.bind(CSSCore, this.getDOMNode())\n );\n }\n this.classNameQueue.length = 0;\n this.timeout = null;\n },\n\n componentWillMount: function() {\n this.classNameQueue = [];\n },\n\n componentWillUnmount: function() {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n },\n\n componentWillReceiveProps: function(nextProps) {\n if (!nextProps.children && this.props.children) {\n this.savedChildren = this.props.children;\n }\n },\n\n componentDidMount: function(node) {\n if (this.props.enter) {\n this.transition('enter');\n }\n },\n\n componentDidUpdate: function(prevProps, prevState, node) {\n if (prevProps.children && !this.props.children) {\n this.transition('leave', true, this.props.onDoneLeaving);\n }\n },\n\n render: function() {\n return this.props.children || this.savedChildren;\n }\n});\n\nmodule.exports = ReactTransitionableChild;\n\nrequire(\"./mock-modules\").register(\"ReactTransitionableChild\", module);\n",
"ReactDoNotBindDeprecated":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDoNotBindDeprecated\n */\n\n\"use strict\";\n\nvar ReactDoNotBindDeprecated = {\n /**\n * Marks the method for not being automatically bound on component mounting. A\n * couple of reasons you might want to use this:\n *\n * - Automatically supporting the previous behavior in components that were\n * built with previous versions of React.\n * - Tuning performance, by avoiding binding on initial render for methods\n * that are always invoked while being preceded by `this.`. Such binds are\n * unnecessary.\n *\n * React.createClass({\n * handleClick: ReactDoNotBindDeprecated.doNotBind(function() {\n * alert(this.setState); // undefined!\n * }),\n * render: function() {\n * return <a onClick={this.handleClick}>Jump</a>;\n * }\n * });\n *\n * @param {function} method Method to avoid automatically binding.\n * @public\n */\n doNotBind: function(method) {\n method.__reactDontBind = true; // Mutating\n return method;\n }\n};\n\nmodule.exports = ReactDoNotBindDeprecated;\n\nrequire(\"./mock-modules\").register(\"ReactDoNotBindDeprecated\", module);\n",
"ReactComponent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactComponent\n */\n\n\"use strict\";\n\nvar ReactComponentEnvironment = require(\"./ReactComponentEnvironment\");\nvar ReactCurrentOwner = require(\"./ReactCurrentOwner\");\nvar ReactOwner = require(\"./ReactOwner\");\nvar ReactUpdates = require(\"./ReactUpdates\");\n\nvar invariant = require(\"./invariant\");\nvar keyMirror = require(\"./keyMirror\");\nvar merge = require(\"./merge\");\n\n/**\n * Every React component is in one of these life cycles.\n */\nvar ComponentLifeCycle = keyMirror({\n /**\n * Mounted components have a DOM node representation and are capable of\n * receiving new props.\n */\n MOUNTED: null,\n /**\n * Unmounted components are inactive and cannot receive new props.\n */\n UNMOUNTED: null\n});\n\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children.\n * This allows us to keep track of children between updates.\n */\n\nvar ownerHasWarned = {};\n\n/**\n * Warn if the component doesn't have an explicit key assigned to it.\n * This component is in an array. The array could grow and shrink or be\n * reordered. All children, that hasn't already been validated, are required to\n * have a \"key\" property assigned to it.\n *\n * @internal\n * @param {ReactComponent} component Component that requires a key.\n */\nfunction validateExplicitKey(component) {\n if (component.__keyValidated__ || component.props.key != null) {\n return;\n }\n component.__keyValidated__ = true;\n\n // We can't provide friendly warnings for top level components.\n if (!ReactCurrentOwner.current) {\n return;\n }\n\n // Name of the component whose render method tried to pass children.\n var currentName = ReactCurrentOwner.current.constructor.displayName;\n if (ownerHasWarned.hasOwnProperty(currentName)) {\n return;\n }\n ownerHasWarned[currentName] = true;\n\n var message = 'Each child in an array should have a unique \"key\" prop. ' +\n 'Check the render method of ' + currentName + '.';\n if (!component.isOwnedBy(ReactCurrentOwner.current)) {\n // Name of the component that originally created this child.\n var childOwnerName =\n component.props.__owner__ &&\n component.props.__owner__.constructor.displayName;\n\n // Usually the current owner is the offender, but if it accepts\n // children as a property, it may be the creator of the child that's\n // responsible for assigning it a key.\n message += ' It was passed a child from ' + childOwnerName + '.';\n }\n\n console.warn(message);\n}\n\n/**\n * Ensure that every component either is passed in a static location or, if\n * if it's passed in an array, has an explicit key property defined.\n *\n * @internal\n * @param {*} component Statically passed child of any type.\n * @return {boolean}\n */\nfunction validateChildKeys(component) {\n if (Array.isArray(component)) {\n for (var i = 0; i < component.length; i++) {\n var child = component[i];\n if (ReactComponent.isValidComponent(child)) {\n validateExplicitKey(child);\n }\n }\n } else if (ReactComponent.isValidComponent(component)) {\n // This component was passed in a valid location.\n component.__keyValidated__ = true;\n }\n}\n\n/**\n * Components are the basic units of composition in React.\n *\n * Every component accepts a set of keyed input parameters known as \"props\" that\n * are initialized by the constructor. Once a component is mounted, the props\n * can be mutated using `setProps` or `replaceProps`.\n *\n * Every component is capable of the following operations:\n *\n * `mountComponent`\n * Initializes the component, renders markup, and registers event listeners.\n *\n * `receiveProps`\n * Updates the rendered DOM nodes given a new set of props.\n *\n * `unmountComponent`\n * Releases any resources allocated by this component.\n *\n * Components can also be \"owned\" by other components. Being owned by another\n * component means being constructed by that component. This is different from\n * being the child of a component, which means having a DOM representation that\n * is a child of the DOM representation of that component.\n *\n * @class ReactComponent\n */\nvar ReactComponent = {\n\n /**\n * @param {?object} object\n * @return {boolean} True if `object` is a valid component.\n * @final\n */\n isValidLine truncated
"ReactCompositeComponent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactCompositeComponent\n */\n\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactCurrentOwner = require(\"./ReactCurrentOwner\");\nvar ReactOwner = require(\"./ReactOwner\");\nvar ReactPerf = require(\"./ReactPerf\");\nvar ReactPropTransferer = require(\"./ReactPropTransferer\");\nvar ReactUpdates = require(\"./ReactUpdates\");\n\nvar invariant = require(\"./invariant\");\nvar keyMirror = require(\"./keyMirror\");\nvar merge = require(\"./merge\");\nvar mixInto = require(\"./mixInto\");\nvar objMap = require(\"./objMap\");\n\n/**\n * Policies that describe methods in `ReactCompositeComponentInterface`.\n */\nvar SpecPolicy = keyMirror({\n /**\n * These methods may be defined only once by the class specification or mixin.\n */\n DEFINE_ONCE: null,\n /**\n * These methods may be defined by both the class specification and mixins.\n * Subsequent definitions will be chained. These methods must return void.\n */\n DEFINE_MANY: null,\n /**\n * These methods are overriding the base ReactCompositeComponent class.\n */\n OVERRIDE_BASE: null,\n /**\n * These methods are similar to DEFINE_MANY, except we assume they return\n * objects. We try to merge the keys of the return values of all the mixed in\n * functions. If there is a key conflict we throw.\n */\n DEFINE_MANY_MERGED: null\n});\n\n/**\n * Composite components are higher-level components that compose other composite\n * or native components.\n *\n * To create a new type of `ReactCompositeComponent`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return <div>Hello World</div>;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will available on the prototype.\n *\n * @interface ReactCompositeComponentInterface\n * @internal\n */\nvar ReactCompositeComponentInterface = {\n\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: SpecPolicy.DEFINE_MANY,\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: SpecPolicy.DEFINE_ONCE,\n\n\n\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: SpecPolicy.DEFINE_MANY_MERGED,\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return <div>Hello, {name}!</div>;\n * }\n *\n * @return {ReactComponent}\n * @nosideeffects\n * @required\n */\n render: SpecPolicy.DEFINE_ONCE,\n\n\n\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: SpecPolicy.DEFINE_MANY,\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guaran Line truncated
"ReactCurrentOwner":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactCurrentOwner\n */\n\n\"use strict\";\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n *\n * The depth indicate how many composite components are above this render level.\n */\nvar ReactCurrentOwner = {\n\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n\n};\n\nmodule.exports = ReactCurrentOwner;\n\nrequire(\"./mock-modules\").register(\"ReactCurrentOwner\", module);\n",
"cx":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule cx\n */\n\n/**\n * This function is used to mark string literals representing CSS class names\n * so that they can be transformed statically. This allows for modularization\n * and minification of CSS class names.\n *\n * In static_upstream, this function is actually implemented, but it should\n * eventually be replaced with something more descriptive, and the transform\n * that is used in the main stack should be ported for use elsewhere.\n *\n * @param string|object className to modularize, or an object of key/values.\n * In the object case, the values are conditions that\n * determine if the className keys should be included.\n * @param [string ...] Variable list of classNames in the string case.\n * @return string Renderable space-separated CSS className.\n */\nfunction cx(classNames) {\n if (typeof classNames == 'object') {\n return Object.keys(classNames).map(function(className) {\n return classNames[className] ? className : '';\n }).join(' ');\n } else {\n return Array.prototype.join.call(arguments, ' ');\n }\n}\n\nmodule.exports = cx;\n\nrequire(\"./mock-modules\").register(\"cx\", module);\n",
"ReactPropTypes":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactPropTypes\n */\n\n\"use strict\";\n\nvar createObjectFrom = require(\"./createObjectFrom\");\nvar invariant = require(\"./invariant\");\n\n/**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var Props = require('ReactPropTypes');\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * invariant(\n * propValue == null ||\n * typeof propValue === 'string' ||\n * propValue instanceof URI,\n * 'Invalid `%s` supplied to `%s`, expected string or URI.',\n * propName,\n * componentName\n * );\n * }\n * },\n * render: function() { ... }\n * });\n *\n * @internal\n */\nvar Props = {\n\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n\n oneOf: createEnumTypeChecker,\n\n instanceOf: createInstanceTypeChecker\n\n};\n\nvar ANONYMOUS = '<<anonymous>>';\n\nfunction createPrimitiveTypeChecker(expectedType) {\n function validatePrimitiveType(propValue, propName, componentName) {\n var propType = typeof propValue;\n if (propType === 'object' && Array.isArray(propValue)) {\n propType = 'array';\n }\n invariant(\n propType === expectedType,\n 'Invalid prop `%s` of type `%s` supplied to `%s`, expected `%s`.',\n propName,\n propType,\n componentName,\n expectedType\n );\n }\n return createChainableTypeChecker(validatePrimitiveType);\n}\n\nfunction createEnumTypeChecker(expectedValues) {\n var expectedEnum = createObjectFrom(expectedValues);\n function validateEnumType(propValue, propName, componentName) {\n invariant(\n expectedEnum[propValue],\n 'Invalid prop `%s` supplied to `%s`, expected one of %s.',\n propName,\n componentName,\n JSON.stringify(Object.keys(expectedEnum))\n );\n }\n return createChainableTypeChecker(validateEnumType);\n}\n\nfunction createInstanceTypeChecker(expectedClass) {\n function validateInstanceType(propValue, propName, componentName) {\n invariant(\n propValue instanceof expectedClass,\n 'Invalid prop `%s` supplied to `%s`, expected instance of `%s`.',\n propName,\n componentName,\n expectedClass.name || ANONYMOUS\n );\n }\n return createChainableTypeChecker(validateInstanceType);\n}\n\nfunction createChainableTypeChecker(validate) {\n function createTypeChecker(isRequired) {\n function checkType(props, propName, componentName) {\n var propValue = props[propName];\n if (propValue != null) {\n // Only validate if there is a value to check.\n validate(propValue, propName, componentName || ANONYMOUS);\n } else {\n invariant(\n !isRequired,\n 'Required prop `%s` was not specified in `%s`.',\n propName,\n componentName || ANONYMOUS\n );\n }\n }\n if (!isRequired) {\n checkType.isRequired = createTypeChecker(true);\n }\n return checkType;\n }\n return createTypeChecker(false);\n}\n\nmodule.expLine truncated
"ReactMount":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactMount\n */\n\n\"use strict\";\n\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactInstanceHandles = require(\"./ReactInstanceHandles\");\n\nvar $ = require(\"./$\");\nvar getReactRootElementInContainer = require(\"./getReactRootElementInContainer\");\nvar invariant = require(\"./invariant\");\nvar nodeContains = require(\"./nodeContains\");\n\nvar SEPARATOR = ReactInstanceHandles.SEPARATOR;\n\nvar ATTR_NAME = 'data-reactid';\nvar nodeCache = {};\n\nvar ELEMENT_NODE_TYPE = 1;\nvar DOC_NODE_TYPE = 9;\n\n/** Mapping from reactRootID to React component instance. */\nvar instancesByReactRootID = {};\n\n/** Mapping from reactRootID to `container` nodes. */\nvar containersByReactRootID = {};\n\nif (true) {\n /** __DEV__-only mapping from reactRootID to root elements. */\n var rootElementsByReactRootID = {};\n}\n\n/**\n * @param {DOMElement} container DOM element that may contain a React component.\n * @return {?string} A \"reactRoot\" ID, if a React component is rendered.\n */\nfunction getReactRootID(container) {\n var rootElement = getReactRootElementInContainer(container);\n return rootElement && ReactMount.getID(rootElement);\n}\n\n/**\n * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form\n * element can return its control whose name or ID equals ATTR_NAME. All\n * DOM nodes support `getAttributeNode` but this can also get called on\n * other objects so just return '' if we're given something other than a\n * DOM node (such as window).\n *\n * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.\n * @return {string} ID of the supplied `domNode`.\n */\nfunction getID(node) {\n var id = internalGetID(node);\n if (id) {\n if (nodeCache.hasOwnProperty(id)) {\n var cached = nodeCache[id];\n if (cached !== node) {\n invariant(\n !isValid(cached, id),\n 'ReactMount: Two valid but unequal nodes with the same `%s`: %s',\n ATTR_NAME, id\n );\n\n nodeCache[id] = node;\n }\n } else {\n nodeCache[id] = node;\n }\n }\n\n return id;\n}\n\nfunction internalGetID(node) {\n // If node is something like a window, document, or text node, none of\n // which support attributes or a .getAttribute method, gracefully return\n // the empty string, as if the attribute were missing.\n return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';\n}\n\n/**\n * Sets the React-specific ID of the given node.\n *\n * @param {DOMElement} node The DOM node whose ID will be set.\n * @param {string} id The value of the ID attribute.\n */\nfunction setID(node, id) {\n var oldID = internalGetID(node);\n if (oldID !== id) {\n delete nodeCache[oldID];\n }\n node.setAttribute(ATTR_NAME, id);\n nodeCache[id] = node;\n}\n\n/**\n * Finds the node with the supplied React-generated DOM ID.\n *\n * @param {string} id A React-generated DOM ID.\n * @return {DOMElement} DOM node with the suppled `id`.\n * @internal\n */\nfunction getNode(id) {\n if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {\n nodeCache[id] = ReactMount.findReactNodeByID(id);\n }\n return nodeCache[id];\n}\n\n/**\n * A node is \"valid\" if it is contained by a currently mounted container.\n *\n * This means that the node does not have to be contained by a document in\n * order to be considered valid.\n *\n * @param {?DOMElement} node The candidate DOM node.\n * @param {string} id The expected ID of the node.\n * @return {boolean} Whether the node is contained by a mounted container.\n */\nfunction isValid(node, id) {\n if (node) {\n invariant(\n internalGetID(node) === id,\n 'ReactMount: Unexpected modification of `%s`',\n ATTR_NAME\n );\n\n var container = ReactMount.findReactContainerForID(id);\n if (container && nodeContains(container, node)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Causes the cache to forget about one React-specific ID.\n *\n * @param {string} id The ID to forget.\n */\nfunction purgeID(id) {\n delete nodeCache[id];\n}\n\n/**\n * Mounting is the process of initializing a React component by creatings its\n * representative DOM elements and inserting them into a supplied `container`.\n * Any prior content inside `container` is destroyed in the process.\n *\n * ReactMount.renderComponent(compoLine truncated
"ReactDOM":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOM\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactDOMComponent = require(\"./ReactDOMComponent\");\n\nvar mergeInto = require(\"./mergeInto\");\nvar objMapKeyVal = require(\"./objMapKeyVal\");\n\n/**\n * Creates a new React class that is idempotent and capable of containing other\n * React components. It accepts event listeners and DOM properties that are\n * valid according to `DOMProperty`.\n *\n * - Event listeners: `onClick`, `onMouseDown`, etc.\n * - DOM properties: `className`, `name`, `title`, etc.\n *\n * The `style` property functions differently from the DOM API. It accepts an\n * object mapping of style properties to values.\n *\n * @param {string} tag Tag name (e.g. `div`).\n * @param {boolean} omitClose True if the close tag should be omitted.\n * @private\n */\nfunction createDOMComponentClass(tag, omitClose) {\n var Constructor = function() {};\n Constructor.prototype = new ReactDOMComponent(tag, omitClose);\n Constructor.prototype.constructor = Constructor;\n Constructor.displayName = tag;\n\n var ConvenienceConstructor = function(props, children) {\n var instance = new Constructor();\n instance.construct.apply(instance, arguments);\n return instance;\n };\n ConvenienceConstructor.componentConstructor = Constructor;\n return ConvenienceConstructor;\n}\n\n/**\n * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.\n * This is also accessible via `React.DOM`.\n *\n * @public\n */\nvar ReactDOM = objMapKeyVal({\n a: false,\n abbr: false,\n address: false,\n area: false,\n article: false,\n aside: false,\n audio: false,\n b: false,\n base: false,\n bdi: false,\n bdo: false,\n big: false,\n blockquote: false,\n body: false,\n br: true,\n button: false,\n canvas: false,\n caption: false,\n cite: false,\n code: false,\n col: true,\n colgroup: false,\n data: false,\n datalist: false,\n dd: false,\n del: false,\n details: false,\n dfn: false,\n div: false,\n dl: false,\n dt: false,\n em: false,\n embed: true,\n fieldset: false,\n figcaption: false,\n figure: false,\n footer: false,\n form: false, // NOTE: Injected, see `ReactDOMForm`.\n h1: false,\n h2: false,\n h3: false,\n h4: false,\n h5: false,\n h6: false,\n head: false,\n header: false,\n hr: true,\n html: false,\n i: false,\n iframe: false,\n img: true,\n input: true,\n ins: false,\n kbd: false,\n keygen: true,\n label: false,\n legend: false,\n li: false,\n link: false,\n main: false,\n map: false,\n mark: false,\n menu: false,\n menuitem: false, // NOTE: Close tag should be omitted, but causes problems.\n meta: true,\n meter: false,\n nav: false,\n noscript: false,\n object: false,\n ol: false,\n optgroup: false,\n option: false,\n output: false,\n p: false,\n param: true,\n pre: false,\n progress: false,\n q: false,\n rp: false,\n rt: false,\n ruby: false,\n s: false,\n samp: false,\n script: false,\n section: false,\n select: false,\n small: false,\n source: false,\n span: false,\n strong: false,\n style: false,\n sub: false,\n summary: false,\n sup: false,\n table: false,\n tbody: false,\n td: false,\n textarea: false, // NOTE: Injected, see `ReactDOMTextarea`.\n tfoot: false,\n th: false,\n thead: false,\n time: false,\n title: false,\n tr: false,\n track: true,\n u: false,\n ul: false,\n 'var': false,\n video: false,\n wbr: false,\n\n // SVG\n circle: false,\n g: false,\n line: false,\n path: false,\n polyline: false,\n rect: false,\n svg: false,\n text: false\n}, createDOMComponentClass);\n\nvar injection = {\n injectComponentClasses: function(componentClasses) {\n mergeInto(ReactDOM, componentClasses);\n }\n};\n\nReactDOM.injection = injection;\n\nmodule.exports = ReactDOM;\n\nrequire(\"./mock-modules\").register(\"ReactDOM\", module);\n",
"ReactReconcileTransaction":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactReconcileTransaction\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\nvar PooledClass = require(\"./PooledClass\");\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactInputSelection = require(\"./ReactInputSelection\");\nvar ReactMountReady = require(\"./ReactMountReady\");\nvar Transaction = require(\"./Transaction\");\n\nvar mixInto = require(\"./mixInto\");\n\n/**\n * Ensures that, when possible, the selection range (currently selected text\n * input) is not disturbed by performing the transaction.\n */\nvar SELECTION_RESTORATION = {\n /**\n * @return {Selection} Selection information.\n */\n initialize: ReactInputSelection.getSelectionInformation,\n /**\n * @param {Selection} sel Selection information returned from `initialize`.\n */\n close: ReactInputSelection.restoreSelection\n};\n\n/**\n * Suppresses events (blur/focus) that could be inadvertently dispatched due to\n * high level DOM manipulations (like temporarily removing a text input from the\n * DOM).\n */\nvar EVENT_SUPPRESSION = {\n /**\n * @return {boolean} The enabled status of `ReactEventEmitter` before the\n * reconciliation.\n */\n initialize: function() {\n var currentlyEnabled = ReactEventEmitter.isEnabled();\n ReactEventEmitter.setEnabled(false);\n return currentlyEnabled;\n },\n\n /**\n * @param {boolean} previouslyEnabled Enabled status of `ReactEventEmitter`\n * before the reconciliation occured. `close` restores the previous value.\n */\n close: function(previouslyEnabled) {\n ReactEventEmitter.setEnabled(previouslyEnabled);\n }\n};\n\n/**\n * Provides a `ReactMountReady` queue for collecting `onDOMReady` callbacks\n * during the performing of the transaction.\n */\nvar ON_DOM_READY_QUEUEING = {\n /**\n * Initializes the internal `onDOMReady` queue.\n */\n initialize: function() {\n this.reactMountReady.reset();\n },\n\n /**\n * After DOM is flushed, invoke all registered `onDOMReady` callbacks.\n */\n close: function() {\n this.reactMountReady.notifyAll();\n }\n};\n\n/**\n * Executed within the scope of the `Transaction` instance. Consider these as\n * being member methods, but with an implied ordering while being isolated from\n * each other.\n */\nvar TRANSACTION_WRAPPERS = [\n SELECTION_RESTORATION,\n EVENT_SUPPRESSION,\n ON_DOM_READY_QUEUEING\n];\n\n/**\n * Currently:\n * - The order that these are listed in the transaction is critical:\n * - Suppresses events.\n * - Restores selection range.\n *\n * Future:\n * - Restore document/overflow scroll positions that were unintentionally\n * modified via DOM insertions above the top viewport boundary.\n * - Implement/integrate with customized constraint based layout system and keep\n * track of which dimensions must be remeasured.\n *\n * @class ReactReconcileTransaction\n */\nfunction ReactReconcileTransaction() {\n this.reinitializeTransaction();\n this.reactMountReady = ReactMountReady.getPooled(null);\n}\n\nvar Mixin = {\n /**\n * @see Transaction\n * @abstract\n * @final\n * @return {array<object>} List of operation wrap proceedures.\n * TODO: convert to array<TransactionWrapper>\n */\n getTransactionWrappers: function() {\n if (ExecutionEnvironment.canUseDOM) {\n return TRANSACTION_WRAPPERS;\n } else {\n return [];\n }\n },\n\n /**\n * @return {object} The queue to collect `onDOMReady` callbacks with.\n * TODO: convert to ReactMountReady\n */\n getReactMountReady: function() {\n return this.reactMountReady;\n },\n\n /**\n * `PooledClass` looks for this, and will invoke this before allowing this\n * instance to be resused.\n */\n destructor: function() {\n ReactMountReady.release(this.reactMountReady);\n this.reactMountReady = null;\n }\n};\n\n\nmixInto(ReactReconcileTransaction, Transaction.Mixin);\nmixInto(ReactReconcileTransaction, Mixin);\n\nPooledClass.addPoolingTo(ReactReconcileTransaction);\n\nmodule.exports = ReactReconcileTransaction;\n\nrequire(\"./mock-modules\").register(\"ReactReconcileTransaction\", module);\n",
"ReactDefaultInjection":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDefaultInjection\n */\n\n\"use strict\";\n\nvar ReactDOM = require(\"./ReactDOM\");\nvar ReactDOMButton = require(\"./ReactDOMButton\");\nvar ReactDOMForm = require(\"./ReactDOMForm\");\nvar ReactDOMInput = require(\"./ReactDOMInput\");\nvar ReactDOMOption = require(\"./ReactDOMOption\");\nvar ReactDOMSelect = require(\"./ReactDOMSelect\");\nvar ReactDOMTextarea = require(\"./ReactDOMTextarea\");\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactEventTopLevelCallback = require(\"./ReactEventTopLevelCallback\");\nvar ReactPerf = require(\"./ReactPerf\");\n\nvar DefaultDOMPropertyConfig = require(\"./DefaultDOMPropertyConfig\");\nvar DOMProperty = require(\"./DOMProperty\");\n\nvar ChangeEventPlugin = require(\"./ChangeEventPlugin\");\nvar CompositionEventPlugin = require(\"./CompositionEventPlugin\");\nvar DefaultEventPluginOrder = require(\"./DefaultEventPluginOrder\");\nvar EnterLeaveEventPlugin = require(\"./EnterLeaveEventPlugin\");\nvar EventPluginHub = require(\"./EventPluginHub\");\nvar MobileSafariClickEventPlugin = require(\"./MobileSafariClickEventPlugin\");\nvar ReactInstanceHandles = require(\"./ReactInstanceHandles\");\nvar SelectEventPlugin = require(\"./SelectEventPlugin\");\nvar SimpleEventPlugin = require(\"./SimpleEventPlugin\");\n\nvar ReactDefaultBatchingStrategy = require(\"./ReactDefaultBatchingStrategy\");\nvar ReactUpdates = require(\"./ReactUpdates\");\n\nfunction inject() {\n ReactEventEmitter.TopLevelCallbackCreator = ReactEventTopLevelCallback;\n /**\n * Inject module for resolving DOM hierarchy and plugin ordering.\n */\n EventPluginHub.injection.injectEventPluginOrder(DefaultEventPluginOrder);\n EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles);\n\n /**\n * Some important event plugins included by default (without having to require\n * them).\n */\n EventPluginHub.injection.injectEventPluginsByName({\n SimpleEventPlugin: SimpleEventPlugin,\n EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n ChangeEventPlugin: ChangeEventPlugin,\n CompositionEventPlugin: CompositionEventPlugin,\n MobileSafariClickEventPlugin: MobileSafariClickEventPlugin,\n SelectEventPlugin: SelectEventPlugin\n });\n\n ReactDOM.injection.injectComponentClasses({\n button: ReactDOMButton,\n form: ReactDOMForm,\n input: ReactDOMInput,\n option: ReactDOMOption,\n select: ReactDOMSelect,\n textarea: ReactDOMTextarea\n });\n\n DOMProperty.injection.injectDOMPropertyConfig(DefaultDOMPropertyConfig);\n\n if (true) {\n ReactPerf.injection.injectMeasure(require(\"./ReactDefaultPerf\").measure);\n }\n\n ReactUpdates.injection.injectBatchingStrategy(\n ReactDefaultBatchingStrategy\n );\n}\n\nmodule.exports = {\n inject: inject\n};\n\nrequire(\"./mock-modules\").register(\"ReactDefaultInjection\", module);\n",
"mixInto":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mixInto\n */\n\n\"use strict\";\n\n/**\n * Simply copies properties to the prototype.\n */\nvar mixInto = function(constructor, methodBag) {\n var methodName;\n for (methodName in methodBag) {\n if (!methodBag.hasOwnProperty(methodName)) {\n continue;\n }\n constructor.prototype[methodName] = methodBag[methodName];\n }\n};\n\nmodule.exports = mixInto;\n\nrequire(\"./mock-modules\").register(\"mixInto\", module);\n",
"ReactDOMComponent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMComponent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar CSSPropertyOperations = require(\"./CSSPropertyOperations\");\nvar DOMProperty = require(\"./DOMProperty\");\nvar DOMPropertyOperations = require(\"./DOMPropertyOperations\");\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactMultiChild = require(\"./ReactMultiChild\");\nvar ReactMount = require(\"./ReactMount\");\nvar ReactPerf = require(\"./ReactPerf\");\n\nvar escapeTextForBrowser = require(\"./escapeTextForBrowser\");\nvar invariant = require(\"./invariant\");\nvar keyOf = require(\"./keyOf\");\nvar merge = require(\"./merge\");\nvar mixInto = require(\"./mixInto\");\n\nvar putListener = ReactEventEmitter.putListener;\nvar deleteListener = ReactEventEmitter.deleteListener;\nvar registrationNames = ReactEventEmitter.registrationNames;\n\n// For quickly matching children type, to test if can be treated as content.\nvar CONTENT_TYPES = {'string': true, 'number': true};\n\nvar STYLE = keyOf({style: null});\n\n/**\n * @param {?object} props\n */\nfunction assertValidProps(props) {\n if (!props) {\n return;\n }\n // Note the use of `==` which checks for null or undefined.\n invariant(\n props.children == null || props.dangerouslySetInnerHTML == null,\n 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.'\n );\n invariant(\n props.style == null || typeof props.style === 'object',\n 'The `style` prop expects a mapping from style properties to values, ' +\n 'not a string.'\n );\n}\n\n/**\n * @constructor ReactDOMComponent\n * @extends ReactComponent\n * @extends ReactMultiChild\n */\nfunction ReactDOMComponent(tag, omitClose) {\n this._tagOpen = '<' + tag;\n this._tagClose = omitClose ? '' : '</' + tag + '>';\n this.tagName = tag.toUpperCase();\n}\n\nReactDOMComponent.Mixin = {\n\n /**\n * Generates root tag markup then recurses. This method has side effects and\n * is not idempotent.\n *\n * @internal\n * @param {string} rootID The root DOM ID for this node.\n * @param {ReactReconcileTransaction} transaction\n * @param {number} mountDepth number of components in the owner hierarchy\n * @return {string} The computed markup.\n */\n mountComponent: ReactPerf.measure(\n 'ReactDOMComponent',\n 'mountComponent',\n function(rootID, transaction, mountDepth) {\n ReactComponent.Mixin.mountComponent.call(\n this,\n rootID,\n transaction,\n mountDepth\n );\n assertValidProps(this.props);\n return (\n this._createOpenTagMarkup() +\n this._createContentMarkup(transaction) +\n this._tagClose\n );\n }\n ),\n\n /**\n * Creates markup for the open tag and all attributes.\n *\n * This method has side effects because events get registered.\n *\n * Iterating over object properties is faster than iterating over arrays.\n * @see http://jsperf.com/obj-vs-arr-iteration\n *\n * @private\n * @return {string} Markup of opening tag.\n */\n _createOpenTagMarkup: function() {\n var props = this.props;\n var ret = this._tagOpen;\n\n for (var propKey in props) {\n if (!props.hasOwnProperty(propKey)) {\n continue;\n }\n var propValue = props[propKey];\n if (propValue == null) {\n continue;\n }\n if (registrationNames[propKey]) {\n putListener(this._rootNodeID, propKey, propValue);\n } else {\n if (propKey === STYLE) {\n if (propValue) {\n propValue = props.style = merge(props.style);\n }\n propValue = CSSPropertyOperations.createMarkupForStyles(propValue);\n }\n var markup =\n DOMPropertyOperations.createMarkupForProperty(propKey, propValue);\n if (markup) {\n ret += ' ' + markup;\n }\n }\n }\n\n var escapedID = escapeTextForBrowser(this._rootNodeID);\n return ret + ' ' + ReactMount.ATTR_NAME + '=\"' + escapedID + '\">';\n },\n\n /**\n * Creates markup for the content between the tags.\n *\n * @private\n * @param {ReactReconcileTransaction} transaction\n * @return {string} Content markup.\n */\n _createContentMarkup: function(transaction) {\n // Intentional use of != to avoid catching zero/false.\n v Line truncated
"ReactMultiChild":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactMultiChild\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactMultiChildUpdateTypes = require(\"./ReactMultiChildUpdateTypes\");\n\nvar flattenChildren = require(\"./flattenChildren\");\n\n/**\n * Given a `curChild` and `newChild`, determines if `curChild` should be\n * updated as opposed to being destroyed or replaced.\n *\n * @param {?ReactComponent} curChild\n * @param {?ReactComponent} newChild\n * @return {boolean} True if `curChild` should be updated with `newChild`.\n * @protected\n */\nfunction shouldUpdateChild(curChild, newChild) {\n return curChild && newChild && curChild.constructor === newChild.constructor;\n}\n\n/**\n * Updating children of a component may trigger recursive updates. The depth is\n * used to batch recursive updates to render markup more efficiently.\n *\n * @type {number}\n * @private\n */\nvar updateDepth = 0;\n\n/**\n * Queue of update configuration objects.\n *\n * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.\n *\n * @type {array<object>}\n * @private\n */\nvar updateQueue = [];\n\n/**\n * Queue of markup to be rendered.\n *\n * @type {array<string>}\n * @private\n */\nvar markupQueue = [];\n\n/**\n * Enqueues markup to be rendered and inserted at a supplied index.\n *\n * @param {string} parentID ID of the parent component.\n * @param {string} markup Markup that renders into an element.\n * @param {number} toIndex Destination index.\n * @private\n */\nfunction enqueueMarkup(parentID, markup, toIndex) {\n // NOTE: Null values reduce hidden classes.\n updateQueue.push({\n parentID: parentID,\n parentNode: null,\n type: ReactMultiChildUpdateTypes.INSERT_MARKUP,\n markupIndex: markupQueue.push(markup) - 1,\n fromIndex: null,\n textContent: null,\n toIndex: toIndex\n });\n}\n\n/**\n * Enqueues moving an existing element to another index.\n *\n * @param {string} parentID ID of the parent component.\n * @param {number} fromIndex Source index of the existing element.\n * @param {number} toIndex Destination index of the element.\n * @private\n */\nfunction enqueueMove(parentID, fromIndex, toIndex) {\n // NOTE: Null values reduce hidden classes.\n updateQueue.push({\n parentID: parentID,\n parentNode: null,\n type: ReactMultiChildUpdateTypes.MOVE_EXISTING,\n markupIndex: null,\n textContent: null,\n fromIndex: fromIndex,\n toIndex: toIndex\n });\n}\n\n/**\n * Enqueues removing an element at an index.\n *\n * @param {string} parentID ID of the parent component.\n * @param {number} fromIndex Index of the element to remove.\n * @private\n */\nfunction enqueueRemove(parentID, fromIndex) {\n // NOTE: Null values reduce hidden classes.\n updateQueue.push({\n parentID: parentID,\n parentNode: null,\n type: ReactMultiChildUpdateTypes.REMOVE_NODE,\n markupIndex: null,\n textContent: null,\n fromIndex: fromIndex,\n toIndex: null\n });\n}\n\n/**\n * Enqueues setting the text content.\n *\n * @param {string} parentID ID of the parent component.\n * @param {string} textContent Text content to set.\n * @private\n */\nfunction enqueueTextContent(parentID, textContent) {\n // NOTE: Null values reduce hidden classes.\n updateQueue.push({\n parentID: parentID,\n parentNode: null,\n type: ReactMultiChildUpdateTypes.TEXT_CONTENT,\n markupIndex: null,\n textContent: textContent,\n fromIndex: null,\n toIndex: null\n });\n}\n\n/**\n * Processes any enqueued updates.\n *\n * @private\n */\nfunction processQueue() {\n if (updateQueue.length) {\n ReactComponent.DOMIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}\n\n/**\n * Clears any enqueued updates.\n *\n * @private\n */\nfunction clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}\n\n/**\n * ReactMultiChild are capable of reconciling multiple children.\n *\n * @class ReactMultiChild\n * @internal\n */\nvar ReactMultiChild = {\n\n /**\n * Provides common functionality for components that must reconcile multiple\n * children. This is used by `ReactDOMComponent` to mount, update, and\n * unmount child components.\n *\n * @lends {ReactMultiChild.prototype}\n */\n Mixin: {\n\n /**\n * Generates a \"mount image\"Line truncated
"ReactEventEmitter":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactEventEmitter\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventListener = require(\"./EventListener\");\nvar EventPluginHub = require(\"./EventPluginHub\");\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\nvar ReactEventEmitterMixin = require(\"./ReactEventEmitterMixin\");\nvar ViewportMetrics = require(\"./ViewportMetrics\");\n\nvar invariant = require(\"./invariant\");\nvar isEventSupported = require(\"./isEventSupported\");\nvar merge = require(\"./merge\");\n\n/**\n * Summary of `ReactEventEmitter` event handling:\n *\n * - Top-level delegation is used to trap native browser events. We normalize\n * and de-duplicate events to account for browser quirks.\n *\n * - Forward these native events (with the associated top-level type used to\n * trap it) to `EventPluginHub`, which in turn will ask plugins if they want\n * to extract any synthetic events.\n *\n * - The `EventPluginHub` will then process each event by annotating them with\n * \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n * - The `EventPluginHub` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * .\n * +------------+ .\n * | DOM | .\n * +------------+ . +-----------+\n * + . +--------+|SimpleEvent|\n * | . | |Plugin |\n * +-----|------+ . v +-----------+\n * | | | . +--------------+ +------------+\n * | +-----------.--->|EventPluginHub| | Event |\n * | | . | | +-----------+ | Propagators|\n * | ReactEvent | . | | |TapEvent | |------------|\n * | Emitter | . | |<---+|Plugin | |other plugin|\n * | | . | | +-----------+ | utilities |\n * | +-----------.---------+ | +------------+\n * | | | . +----|---------+\n * +-----|------+ . | ^ +-----------+\n * | . | | |Enter/Leave|\n * + . | +-------+|Plugin |\n * +-------------+ . v +-----------+\n * | application | . +----------+\n * |-------------| . | callback |\n * | | . | registry |\n * | | . +----------+\n * +-------------+ .\n * .\n * React Core . General Purpose Event Plugin System\n */\n\n/**\n * Traps top-level events by using event bubbling.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {string} handlerBaseName Event name (e.g. \"click\").\n * @param {DOMEventTarget} element Element on which to attach listener.\n * @internal\n */\nfunction trapBubbledEvent(topLevelType, handlerBaseName, element) {\n EventListener.listen(\n element,\n handlerBaseName,\n ReactEventEmitter.TopLevelCallbackCreator.createTopLevelCallback(\n topLevelType\n )\n );\n}\n\n/**\n * Traps a top-level event by using event capturing.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {string} handlerBaseName Event name (e.g. \"click\").\n * @param {DOMEventTarget} element Element on which to attach listener.\n * @internal\n */\nfunction trapCapturedEvent(topLevelType, handlerBaseName, element) {\n EventListener.capture(\n element,\n handlerBaseName,\n ReactEventEmitter.TopLevelCallbackCreator.createTopLevelCallback(\n topLevelType\n )\n );\n}\n\n/**\n * Listens to window scroll and resize events. We cache scroll values so that\n * application code can access them without triggering reflows.\n *\n * NOTE: Scroll events do not bubble.\n *\n * @private\n * @see http://www.quirksmode.org/dom/events/scroll.html\n */\nfunction registerScrollValueMonitoring() {\n var refresh = ViewportMetrics.refreshScrollValues;\n EventListener.listen(window, 'scroll', refresh);\n EventListener.listen(window, 'resize', refresh);\n}\n\n/**\n * `ReactEventEmitter` is used to attach top-level event listeners. For example:\n *\n * ReactEventEmitter.putListener('myID', 'onClick', Line truncated
"DOMPropertyOperations":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule DOMPropertyOperations\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar DOMProperty = require(\"./DOMProperty\");\n\nvar escapeTextForBrowser = require(\"./escapeTextForBrowser\");\nvar memoizeStringOnly = require(\"./memoizeStringOnly\");\n\nvar processAttributeNameAndPrefix = memoizeStringOnly(function(name) {\n return escapeTextForBrowser(name) + '=\"';\n});\n\nif (true) {\n var reactProps = {\n __owner__: true,\n children: true,\n dangerouslySetInnerHTML: true,\n key: true,\n ref: true\n };\n var warnedProperties = {};\n\n var warnUnknownProperty = function(name) {\n if (reactProps[name] || warnedProperties[name]) {\n return;\n }\n\n warnedProperties[name] = true;\n var lowerCasedName = name.toLowerCase();\n\n // data-* attributes should be lowercase; suggest the lowercase version\n var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ?\n lowerCasedName : DOMProperty.getPossibleStandardName[lowerCasedName];\n\n // For now, only warn when we have a suggested correction. This prevents\n // logging too much when using transferPropsTo.\n if (standardName != null) {\n console.warn(\n 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'\n );\n }\n\n };\n}\n\n/**\n * Operations for dealing with DOM properties.\n */\nvar DOMPropertyOperations = {\n\n /**\n * Creates markup for a property.\n *\n * @param {string} name\n * @param {*} value\n * @return {?string} Markup string, or null if the property was invalid.\n */\n createMarkupForProperty: function(name, value) {\n if (DOMProperty.isStandardName[name]) {\n if (value == null || DOMProperty.hasBooleanValue[name] && !value) {\n return '';\n }\n var attributeName = DOMProperty.getAttributeName[name];\n return processAttributeNameAndPrefix(attributeName) +\n escapeTextForBrowser(value) + '\"';\n } else if (DOMProperty.isCustomAttribute(name)) {\n if (value == null) {\n return '';\n }\n return processAttributeNameAndPrefix(name) +\n escapeTextForBrowser(value) + '\"';\n } else if (true) {\n warnUnknownProperty(name);\n }\n return null;\n },\n\n /**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n setValueForProperty: function(node, name, value) {\n if (DOMProperty.isStandardName[name]) {\n var mutationMethod = DOMProperty.getMutationMethod[name];\n if (mutationMethod) {\n mutationMethod(node, value);\n } else if (DOMProperty.mustUseAttribute[name]) {\n if (DOMProperty.hasBooleanValue[name] && !value) {\n node.removeAttribute(DOMProperty.getAttributeName[name]);\n } else {\n node.setAttribute(DOMProperty.getAttributeName[name], '' + value);\n }\n } else {\n var propName = DOMProperty.getPropertyName[name];\n if (!DOMProperty.hasSideEffects[name] || node[propName] !== value) {\n node[propName] = value;\n }\n }\n } else if (DOMProperty.isCustomAttribute(name)) {\n node.setAttribute(name, '' + value);\n } else if (true) {\n warnUnknownProperty(name);\n }\n },\n\n /**\n * Deletes the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n */\n deleteValueForProperty: function(node, name) {\n if (DOMProperty.isStandardName[name]) {\n var mutationMethod = DOMProperty.getMutationMethod[name];\n if (mutationMethod) {\n mutationMethod(node, undefined);\n } else if (DOMProperty.mustUseAttribute[name]) {\n node.removeAttribute(DOMProperty.getAttributeName[name]);\n } else {\n var propName = DOMProperty.getPropertyName[name];\n node[propName] = DOMProperty.getDefaultValueForProperty(\n node.nodeName,\n name\n );\n }\n } else if (DOMProperty.isCustomAttribute(name)) {\n node.removeAttribute(name);\n } else if (true) {\n warnUnknownProperty(name);\n }\n }\n\n};\n\nmodule.exports = DOMPropertyOperations;\n\nrequire(\"./mock-modules\").register(\"DOMPropertyOperations\", module);\n",
"ReactDOMIDOperations":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMIDOperations\n * @typechecks static-only\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar CSSPropertyOperations = require(\"./CSSPropertyOperations\");\nvar DOMChildrenOperations = require(\"./DOMChildrenOperations\");\nvar DOMPropertyOperations = require(\"./DOMPropertyOperations\");\nvar ReactMount = require(\"./ReactMount\");\n\nvar getTextContentAccessor = require(\"./getTextContentAccessor\");\nvar invariant = require(\"./invariant\");\n\n/**\n * Errors for properties that should not be updated with `updatePropertyById()`.\n *\n * @type {object}\n * @private\n */\nvar INVALID_PROPERTY_ERRORS = {\n dangerouslySetInnerHTML:\n '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',\n style: '`style` must be set using `updateStylesByID()`.'\n};\n\n/**\n * The DOM property to use when setting text content.\n *\n * @type {string}\n * @private\n */\nvar textContentAccessor = getTextContentAccessor() || 'NA';\n\nvar LEADING_SPACE = /^ /;\n\n/**\n * Operations used to process updates to DOM nodes. This is made injectable via\n * `ReactComponent.DOMIDOperations`.\n */\nvar ReactDOMIDOperations = {\n\n /**\n * Updates a DOM node with new property values. This should only be used to\n * update DOM properties in `DOMProperty`.\n *\n * @param {string} id ID of the node to update.\n * @param {string} name A valid property name, see `DOMProperty`.\n * @param {*} value New value of the property.\n * @internal\n */\n updatePropertyByID: function(id, name, value) {\n var node = ReactMount.getNode(id);\n invariant(\n !INVALID_PROPERTY_ERRORS.hasOwnProperty(name),\n 'updatePropertyByID(...): %s',\n INVALID_PROPERTY_ERRORS[name]\n );\n\n // If we're updating to null or undefined, we should remove the property\n // from the DOM node instead of inadvertantly setting to a string. This\n // brings us in line with the same behavior we have on initial render.\n if (value != null) {\n DOMPropertyOperations.setValueForProperty(node, name, value);\n } else {\n DOMPropertyOperations.deleteValueForProperty(node, name);\n }\n },\n\n /**\n * Updates a DOM node to remove a property. This should only be used to remove\n * DOM properties in `DOMProperty`.\n *\n * @param {string} id ID of the node to update.\n * @param {string} name A property name to remove, see `DOMProperty`.\n * @internal\n */\n deletePropertyByID: function(id, name, value) {\n var node = ReactMount.getNode(id);\n invariant(\n !INVALID_PROPERTY_ERRORS.hasOwnProperty(name),\n 'updatePropertyByID(...): %s',\n INVALID_PROPERTY_ERRORS[name]\n );\n DOMPropertyOperations.deleteValueForProperty(node, name, value);\n },\n\n /**\n * This should almost never be used instead of `updatePropertyByID()` due to\n * the extra object allocation required by the API. That said, this is useful\n * for batching up several operations across worker thread boundaries.\n *\n * @param {string} id ID of the node to update.\n * @param {object} properties A mapping of valid property names.\n * @internal\n * @see {ReactDOMIDOperations.updatePropertyByID}\n */\n updatePropertiesByID: function(id, properties) {\n for (var name in properties) {\n if (!properties.hasOwnProperty(name)) {\n continue;\n }\n ReactDOMIDOperations.updatePropertiesByID(id, name, properties[name]);\n }\n },\n\n /**\n * Updates a DOM node with new style values. If a value is specified as '',\n * the corresponding style property will be unset.\n *\n * @param {string} id ID of the node to update.\n * @param {object} styles Mapping from styles to values.\n * @internal\n */\n updateStylesByID: function(id, styles) {\n var node = ReactMount.getNode(id);\n CSSPropertyOperations.setValueForStyles(node, styles);\n },\n\n /**\n * Updates a DOM node's innerHTML.\n *\n * @param {string} id ID of the node to update.\n * @param {string} html An HTML string.\n * @internal\n */\n updateInnerHTMLByID: function(id, html) {\n var node = ReactMount.getNode(id);\n // HACK: IE8- normalize whitespace in innerHTML, removing leading spaces.\n // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html\n node.innerHTML = html.replace(LEADING_SPACE, '&nb Line truncated
"keyOf":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule keyOf\n */\n\n/**\n * Allows extraction of a minified key. Let's the build system minify keys\n * without loosing the ability to dynamically use key strings as values\n * themselves. Pass in an object with a single key/val pair and it will return\n * you the string key of that single record. Suppose you want to grab the\n * value for a key 'className' inside of an object. Key/val minification may\n * have aliased that key to be 'xa12'. keyOf({className: null}) will return\n * 'xa12' in that case. Resolve keys you want to use once at startup time, then\n * reuse those resolutions.\n */\nvar keyOf = function(oneKeyObj) {\n var key;\n for (key in oneKeyObj) {\n if (!oneKeyObj.hasOwnProperty(key)) {\n continue;\n }\n return key;\n }\n return null;\n};\n\n\nmodule.exports = keyOf;\n\nrequire(\"./mock-modules\").register(\"keyOf\", module);\n",
"EventPluginHub":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventPluginHub\n */\n\n\"use strict\";\n\nvar CallbackRegistry = require(\"./CallbackRegistry\");\nvar EventPluginRegistry = require(\"./EventPluginRegistry\");\nvar EventPluginUtils = require(\"./EventPluginUtils\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar accumulate = require(\"./accumulate\");\nvar forEachAccumulated = require(\"./forEachAccumulated\");\nvar invariant = require(\"./invariant\");\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\nvar eventQueue = null;\n\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\nvar executeDispatchesAndRelease = function(event) {\n if (event) {\n var executeDispatch = EventPluginUtils.executeDispatch;\n // Plugins can provide custom behavior when dispatching events.\n var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event);\n if (PluginModule && PluginModule.executeDispatch) {\n executeDispatch = PluginModule.executeDispatch;\n }\n EventPluginUtils.executeDispatchesInOrder(event, executeDispatch);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\n\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n * `extractEvents` {function(string, DOMEventTarget, string, object): *}\n * Required. When a top-level event is fired, this method is expected to\n * extract synthetic events that will in turn be queued and dispatched.\n *\n * `eventTypes` {object}\n * Optional, plugins that fire events must publish a mapping of registration\n * names that are used to register listeners. Values of this mapping must\n * be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n * `executeDispatch` {function(object, function, string)}\n * Optional, allows plugins to override how an event gets dispatched. By\n * default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\nvar EventPluginHub = {\n\n /**\n * Methods for injecting dependencies.\n */\n injection: {\n\n /**\n * @param {object} InjectedInstanceHandle\n * @public\n */\n injectInstanceHandle: EventPropagators.injection.injectInstanceHandle,\n\n /**\n * @param {array} InjectedEventPluginOrder\n * @public\n */\n injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,\n\n /**\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n */\n injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName\n\n },\n\n registrationNames: EventPluginRegistry.registrationNames,\n\n putListener: CallbackRegistry.putListener,\n\n getListener: CallbackRegistry.getListener,\n\n deleteListener: CallbackRegistry.deleteListener,\n\n deleteAllListeners: CallbackRegistry.deleteAllListeners,\n\n /**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\n extractEvents: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent) {\n var events;\n var plugins = EventPluginRegistry.plugins;\n for (var i = 0, l = plugins.length; i < l; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n );\n if (extractedEvents) {\n events = accumulate(events, extractedEvents);\n }\n }\n }\n Line truncated
"TapEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule TapEventPlugin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar EventPluginUtils = require(\"./EventPluginUtils\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\nvar TouchEventUtils = require(\"./TouchEventUtils\");\nvar ViewportMetrics = require(\"./ViewportMetrics\");\n\nvar keyOf = require(\"./keyOf\");\n\nvar isStartish = EventPluginUtils.isStartish;\nvar isEndish = EventPluginUtils.isEndish;\n\n/**\n * Number of pixels that are tolerated in between a `touchStart` and `touchEnd`\n * in order to still be considered a 'tap' event.\n */\nvar tapMoveThreshold = 10;\nvar startCoords = {x: null, y: null};\n\nvar Axis = {\n x: {page: 'pageX', client: 'clientX', envScroll: 'currentPageScrollLeft'},\n y: {page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop'}\n};\n\nfunction getAxisCoordOfEvent(axis, nativeEvent) {\n var singleTouch = TouchEventUtils.extractSingleTouch(nativeEvent);\n if (singleTouch) {\n return singleTouch[axis.page];\n }\n return axis.page in nativeEvent ?\n nativeEvent[axis.page] :\n nativeEvent[axis.client] + ViewportMetrics[axis.envScroll];\n}\n\nfunction getDistance(coords, nativeEvent) {\n var pageX = getAxisCoordOfEvent(Axis.x, nativeEvent);\n var pageY = getAxisCoordOfEvent(Axis.y, nativeEvent);\n return Math.pow(\n Math.pow(pageX - coords.x, 2) + Math.pow(pageY - coords.y, 2),\n 0.5\n );\n}\n\nvar eventTypes = {\n touchTap: {\n phasedRegistrationNames: {\n bubbled: keyOf({onTouchTap: null}),\n captured: keyOf({onTouchTapCapture: null})\n }\n }\n};\n\nvar TapEventPlugin = {\n\n tapMoveThreshold: tapMoveThreshold,\n\n eventTypes: eventTypes,\n\n /**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {*} An accumulation of synthetic events.\n * @see {EventPluginHub.extractEvents}\n */\n extractEvents: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent) {\n if (!isStartish(topLevelType) && !isEndish(topLevelType)) {\n return null;\n }\n var event = null;\n var distance = getDistance(startCoords, nativeEvent);\n if (isEndish(topLevelType) && distance < tapMoveThreshold) {\n event = SyntheticUIEvent.getPooled(\n eventTypes.touchTap,\n topLevelTargetID,\n nativeEvent\n );\n }\n if (isStartish(topLevelType)) {\n startCoords.x = getAxisCoordOfEvent(Axis.x, nativeEvent);\n startCoords.y = getAxisCoordOfEvent(Axis.y, nativeEvent);\n } else if (isEndish(topLevelType)) {\n startCoords.x = 0;\n startCoords.y = 0;\n }\n EventPropagators.accumulateTwoPhaseDispatches(event);\n return event;\n }\n\n};\n\nmodule.exports = TapEventPlugin;\n\nrequire(\"./mock-modules\").register(\"TapEventPlugin\", module);\n",
"ReactInstanceHandles":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactInstanceHandles\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\nvar SEPARATOR = '.';\nvar SEPARATOR_LENGTH = SEPARATOR.length;\n\n/**\n * Maximum depth of traversals before we consider the possibility of a bad ID.\n */\nvar MAX_TREE_DEPTH = 100;\n\n/**\n * Size of the reactRoot ID space. We generate random numbers for React root\n * IDs and if there's a collision the events and DOM update system will\n * get confused. If we assume 100 React components per page, and a user\n * loads 1 page per minute 24/7 for 50 years, with a mount point space of\n * 9,999,999 the likelihood of never having a collision is 99.997%.\n */\nvar GLOBAL_MOUNT_POINT_MAX = 9999999;\n\n/**\n * Creates a DOM ID prefix to use when mounting React components.\n *\n * @param {number} index A unique integer\n * @return {string} React root ID.\n * @internal\n */\nfunction getReactRootIDString(index) {\n return SEPARATOR + 'r[' + index.toString(36) + ']';\n}\n\n/**\n * Checks if a character in the supplied ID is a separator or the end.\n *\n * @param {string} id A React DOM ID.\n * @param {number} index Index of the character to check.\n * @return {boolean} True if the character is a separator or end of the ID.\n * @private\n */\nfunction isBoundary(id, index) {\n return id.charAt(index) === SEPARATOR || index === id.length;\n}\n\n/**\n * Checks if the supplied string is a valid React DOM ID.\n *\n * @param {string} id A React DOM ID, maybe.\n * @return {boolean} True if the string is a valid React DOM ID.\n * @private\n */\nfunction isValidID(id) {\n return id === '' || (\n id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR\n );\n}\n\n/**\n * Checks if the first ID is an ancestor of or equal to the second ID.\n *\n * @param {string} ancestorID\n * @param {string} descendantID\n * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.\n * @internal\n */\nfunction isAncestorIDOf(ancestorID, descendantID) {\n return (\n descendantID.indexOf(ancestorID) === 0 &&\n isBoundary(descendantID, ancestorID.length)\n );\n}\n\n/**\n * Gets the parent ID of the supplied React DOM ID, `id`.\n *\n * @param {string} id ID of a component.\n * @return {string} ID of the parent, or an empty string.\n * @private\n */\nfunction getParentID(id) {\n return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';\n}\n\n/**\n * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the\n * supplied `destinationID`. If they are equal, the ID is returned.\n *\n * @param {string} ancestorID ID of an ancestor node of `destinationID`.\n * @param {string} destinationID ID of the destination node.\n * @return {string} Next ID on the path from `ancestorID` to `destinationID`.\n * @private\n */\nfunction getNextDescendantID(ancestorID, destinationID) {\n invariant(\n isValidID(ancestorID) && isValidID(destinationID),\n 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.',\n ancestorID,\n destinationID\n );\n invariant(\n isAncestorIDOf(ancestorID, destinationID),\n 'getNextDescendantID(...): React has made an invalid assumption about ' +\n 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.',\n ancestorID,\n destinationID\n );\n if (ancestorID === destinationID) {\n return ancestorID;\n }\n // Skip over the ancestor and the immediate separator. Traverse until we hit\n // another separator or we reach the end of `destinationID`.\n var start = ancestorID.length + SEPARATOR_LENGTH;\n for (var i = start; i < destinationID.length; i++) {\n if (isBoundary(destinationID, i)) {\n break;\n }\n }\n return destinationID.substr(0, i);\n}\n\n/**\n * Gets the nearest common ancestor ID of two IDs.\n *\n * Using this ID scheme, the nearest common ancestor ID is the longest common\n * prefix of the two IDs that immediately preceded a \"marker\" in both strings.\n *\n * @param {string} oneID\n * @param {string} twoID\n * @return {string} Nearest common ancestor ID, or the empty string if none.\n * @private\n */\nfunction getFirstCommonAncestorID(oneID, twoID) {\n var minLength = Math.min(oneID.length, twoID.length);\n if (minLength === 0) {\n return '';\n }\n var lastCommonMarkerIndex = 0;\n // Use `<=` to traverse until the \"EOL\" of the shorter sLine truncated
"objMapKeyVal":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule objMapKeyVal\n */\n\n\"use strict\";\n\n/**\n * Behaves the same as `objMap` but invokes func with the key first, and value\n * second. Use `objMap` unless you need this special case.\n * Invokes func as:\n *\n * func(key, value, iteration)\n *\n * @param {?object} obj Object to map keys over\n * @param {!function} func Invoked for each key/val pair.\n * @param {?*} context\n * @return {?object} Result of mapping or null if obj is falsey\n */\nfunction objMapKeyVal(obj, func, context) {\n if (!obj) {\n return null;\n }\n var i = 0;\n var ret = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n ret[key] = func.call(context, key, obj[key], i++);\n }\n }\n return ret;\n}\n\nmodule.exports = objMapKeyVal;\n\nrequire(\"./mock-modules\").register(\"objMapKeyVal\", module);\n",
"getTestDocument":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getTestDocument\n */\n\n/**\n * We need to work around the fact that we have two different\n * test implementations: once that breaks if we clobber document\n * (open-source) and one that doesn't support createHTMLDocument()\n * (jst).\n */\nfunction getTestDocument() {\n if (document.implementation &&\n document.implementation.createHTMLDocument) {\n return document.implementation.createHTMLDocument('test doc');\n }\n return null;\n}\n\nmodule.exports = getTestDocument;\n\nrequire(\"./mock-modules\").register(\"getTestDocument\", module);\n",
"ReactStateSetters":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactStateSetters\n */\n\n\"use strict\";\n\nvar ReactStateSetters = {\n /**\n * Returns a function that calls the provided function, and uses the result\n * of that to set the component's state.\n *\n * @param {ReactCompositeComponent} component\n * @param {function} funcReturningState Returned callback uses this to\n * determine how to update state.\n * @return {function} callback that when invoked uses funcReturningState to\n * determined the object literal to setState.\n */\n createStateSetter: function(component, funcReturningState) {\n return function(a, b, c, d, e, f) {\n var partialState = funcReturningState.call(component, a, b, c, d, e, f);\n if (partialState) {\n component.setState(partialState);\n }\n };\n },\n\n /**\n * Returns a single-argument callback that can be used to update a single\n * key in the component's state.\n *\n * Note: this is memoized function, which makes it inexpensive to call.\n *\n * @param {ReactCompositeComponent} component\n * @param {string} key The key in the state that you should update.\n * @return {function} callback of 1 argument which calls setState() with\n * the provided keyName and callback argument.\n */\n createStateKeySetter: function(component, key) {\n // Memoize the setters.\n var cache = component.__keySetters || (component.__keySetters = {});\n return cache[key] || (cache[key] = createStateKeySetter(component, key));\n }\n};\n\nfunction createStateKeySetter(component, key) {\n // Partial state is allocated outside of the function closure so it can be\n // reused with every call, avoiding memory allocation when this function\n // is called.\n var partialState = {};\n return function stateKeySetter(value) {\n partialState[key] = value;\n component.setState(partialState);\n };\n}\n\nReactStateSetters.Mixin = {\n /**\n * Returns a function that calls the provided function, and uses the result\n * of that to set the component's state.\n *\n * For example, these statements are equivalent:\n *\n * this.setState({x: 1});\n * this.createStateSetter(function(xValue) {\n * return {x: xValue};\n * })(1);\n *\n * @param {function} funcReturningState Returned callback uses this to\n * determine how to update state.\n * @return {function} callback that when invoked uses funcReturningState to\n * determined the object literal to setState.\n */\n createStateSetter: function(funcReturningState) {\n return ReactStateSetters.createStateSetter(this, funcReturningState);\n },\n\n /**\n * Returns a single-argument callback that can be used to update a single\n * key in the component's state.\n *\n * For example, these statements are equivalent:\n *\n * this.setState({x: 1});\n * this.createStateKeySetter('x')(1);\n *\n * Note: this is memoized function, which makes it inexpensive to call.\n *\n * @param {string} key The key in the state that you should update.\n * @return {function} callback of 1 argument which calls setState() with\n * the provided keyName and callback argument.\n */\n createStateKeySetter: function(key) {\n return ReactStateSetters.createStateKeySetter(this, key);\n }\n};\n\nmodule.exports = ReactStateSetters;\n\nrequire(\"./mock-modules\").register(\"ReactStateSetters\", module);\n",
"ReactUpdates":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactUpdates\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\nvar dirtyComponents = [];\n\nvar batchingStrategy = null;\n\nfunction ensureBatchingStrategy() {\n invariant(batchingStrategy, 'ReactUpdates: must inject a batching strategy');\n}\n\nfunction batchedUpdates(callback, param) {\n ensureBatchingStrategy();\n batchingStrategy.batchedUpdates(callback, param);\n}\n\n/**\n * Array comparator for ReactComponents by owner depth\n *\n * @param {ReactComponent} c1 first component you're comparing\n * @param {ReactComponent} c2 second component you're comparing\n * @return {number} Return value usable by Array.prototype.sort().\n */\nfunction mountDepthComparator(c1, c2) {\n return c1._mountDepth - c2._mountDepth;\n}\n\nfunction runBatchedUpdates() {\n // Since reconciling a component higher in the owner hierarchy usually (not\n // always -- see shouldComponentUpdate()) will reconcile children, reconcile\n // them before their children by sorting the array.\n\n dirtyComponents.sort(mountDepthComparator);\n\n for (var i = 0; i < dirtyComponents.length; i++) {\n // If a component is unmounted before pending changes apply, ignore them\n // TODO: Queue unmounts in the same list to avoid this happening at all\n var component = dirtyComponents[i];\n if (component.isMounted()) {\n // If performUpdateIfNecessary happens to enqueue any new updates, we\n // shouldn't execute the callbacks until the next render happens, so\n // stash the callbacks first\n var callbacks = component._pendingCallbacks;\n component._pendingCallbacks = null;\n component.performUpdateIfNecessary();\n if (callbacks) {\n for (var j = 0; j < callbacks.length; j++) {\n callbacks[j].call(component);\n }\n }\n }\n }\n}\n\nfunction clearDirtyComponents() {\n dirtyComponents.length = 0;\n}\n\nfunction flushBatchedUpdates() {\n // Run these in separate functions so the JIT can optimize\n try {\n runBatchedUpdates();\n } catch (e) {\n // IE 8 requires catch to use finally.\n throw e;\n } finally {\n clearDirtyComponents();\n }\n}\n\n/**\n * Mark a component as needing a rerender, adding an optional callback to a\n * list of functions which will be executed once the rerender occurs.\n */\nfunction enqueueUpdate(component, callback) {\n invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n );\n ensureBatchingStrategy();\n\n if (!batchingStrategy.isBatchingUpdates) {\n component.performUpdateIfNecessary();\n callback && callback();\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}\n\nvar ReactUpdatesInjection = {\n injectBatchingStrategy: function(_batchingStrategy) {\n invariant(\n _batchingStrategy,\n 'ReactUpdates: must provide a batching strategy'\n );\n invariant(\n typeof _batchingStrategy.batchedUpdates === 'function',\n 'ReactUpdates: must provide a batchedUpdates() function'\n );\n invariant(\n typeof _batchingStrategy.isBatchingUpdates === 'boolean',\n 'ReactUpdates: must provide an isBatchingUpdates boolean attribute'\n );\n batchingStrategy = _batchingStrategy;\n }\n};\n\nvar ReactUpdates = {\n batchedUpdates: batchedUpdates,\n enqueueUpdate: enqueueUpdate,\n flushBatchedUpdates: flushBatchedUpdates,\n injection: ReactUpdatesInjection\n};\n\nmodule.exports = ReactUpdates;\n\nrequire(\"./mock-modules\").register(\"ReactUpdates\", module);\n",
"CSSPropertyOperations":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule CSSPropertyOperations\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar CSSProperty = require(\"./CSSProperty\");\n\nvar dangerousStyleValue = require(\"./dangerousStyleValue\");\nvar escapeTextForBrowser = require(\"./escapeTextForBrowser\");\nvar hyphenate = require(\"./hyphenate\");\nvar memoizeStringOnly = require(\"./memoizeStringOnly\");\n\nvar processStyleName = memoizeStringOnly(function(styleName) {\n return escapeTextForBrowser(hyphenate(styleName));\n});\n\n/**\n * Operations for dealing with CSS properties.\n */\nvar CSSPropertyOperations = {\n\n /**\n * Serializes a mapping of style properties for use as inline styles:\n *\n * > createMarkupForStyles({width: '200px', height: 0})\n * \"width:200px;height:0;\"\n *\n * Undefined values are ignored so that declarative programming is easier.\n *\n * @param {object} styles\n * @return {?string}\n */\n createMarkupForStyles: function(styles) {\n var serialized = '';\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n var styleValue = styles[styleName];\n if (styleValue != null) {\n serialized += processStyleName(styleName) + ':';\n serialized += dangerousStyleValue(styleName, styleValue) + ';';\n }\n }\n return serialized || null;\n },\n\n /**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n setValueForStyles: function(node, styles) {\n var style = node.style;\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n var styleValue = dangerousStyleValue(styleName, styles[styleName]);\n if (styleValue) {\n style[styleName] = styleValue;\n } else {\n var expansion = CSSProperty.shorthandPropertyExpansions[styleName];\n if (expansion) {\n // Shorthand property that IE8 won't like unsetting, so unset each\n // component to placate it\n for (var individualStyleName in expansion) {\n style[individualStyleName] = '';\n }\n } else {\n style[styleName] = '';\n }\n }\n }\n }\n\n};\n\nmodule.exports = CSSPropertyOperations;\n\nrequire(\"./mock-modules\").register(\"CSSPropertyOperations\", module);\n",
"DOMProperty":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule DOMProperty\n * @typechecks static-only\n */\n\n/*jslint bitwise: true */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\nvar DOMPropertyInjection = {\n /**\n * Mapping from normalized, camelcased property names to a configuration that\n * specifies how the associated DOM property should be accessed or rendered.\n */\n MUST_USE_ATTRIBUTE: 0x1,\n MUST_USE_PROPERTY: 0x2,\n HAS_BOOLEAN_VALUE: 0x4,\n HAS_SIDE_EFFECTS: 0x8,\n\n /**\n * Inject some specialized knowledge about the DOM. This takes a config object\n * with the following properties:\n *\n * isCustomAttribute: function that given an attribute name will return true\n * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*\n * attributes where it's impossible to enumerate all of the possible\n * attribute names,\n *\n * Properties: object mapping DOM property name to one of the\n * DOMPropertyInjection constants or null. If your attribute isn't in here,\n * it won't get written to the DOM.\n *\n * DOMAttributeNames: object mapping React attribute name to the DOM\n * attribute name. Attribute names not specified use the **lowercase**\n * normalized name.\n *\n * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.\n * Property names not specified use the normalized name.\n *\n * DOMMutationMethods: Properties that require special mutation methods. If\n * `value` is undefined, the mutation method should unset the property.\n *\n * @param {object} domPropertyConfig the config as described above.\n */\n injectDOMPropertyConfig: function(domPropertyConfig) {\n var Properties = domPropertyConfig.Properties || {};\n var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};\n var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};\n var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};\n\n if (domPropertyConfig.isCustomAttribute) {\n DOMProperty._isCustomAttributeFunctions.push(\n domPropertyConfig.isCustomAttribute\n );\n }\n\n for (var propName in Properties) {\n invariant(\n !DOMProperty.isStandardName[propName],\n 'injectDOMPropertyConfig(...): You\\'re trying to inject DOM property ' +\n '\\'%s\\' which has already been injected. You may be accidentally ' +\n 'injecting the same DOM property config twice, or you may be ' +\n 'injecting two configs that have conflicting property names.',\n propName\n );\n\n DOMProperty.isStandardName[propName] = true;\n\n var lowerCased = propName.toLowerCase();\n DOMProperty.getPossibleStandardName[lowerCased] = propName;\n\n var attributeName = DOMAttributeNames[propName];\n if (attributeName) {\n DOMProperty.getPossibleStandardName[attributeName] = propName;\n }\n\n DOMProperty.getAttributeName[propName] = attributeName || lowerCased;\n\n DOMProperty.getPropertyName[propName] =\n DOMPropertyNames[propName] || propName;\n\n var mutationMethod = DOMMutationMethods[propName];\n if (mutationMethod) {\n DOMProperty.getMutationMethod[propName] = mutationMethod;\n }\n\n var propConfig = Properties[propName];\n DOMProperty.mustUseAttribute[propName] =\n propConfig & DOMPropertyInjection.MUST_USE_ATTRIBUTE;\n DOMProperty.mustUseProperty[propName] =\n propConfig & DOMPropertyInjection.MUST_USE_PROPERTY;\n DOMProperty.hasBooleanValue[propName] =\n propConfig & DOMPropertyInjection.HAS_BOOLEAN_VALUE;\n DOMProperty.hasSideEffects[propName] =\n propConfig & DOMPropertyInjection.HAS_SIDE_EFFECTS;\n\n invariant(\n !DOMProperty.mustUseAttribute[propName] ||\n !DOMProperty.mustUseProperty[propName],\n 'DOMProperty: Cannot use require using both attribute and property: %s',\n propName\n );\n invariant(\n DOMProperty.mustUseProperty[propName] ||\n !DOMProperty.hasSideEffects[propName],\n 'DOMProperty: Properties that have side effects must use property: %s',\n propName\n );\n }\n }\n};\nvar defaultValueCache = {};\n\n/**\n * DOMProperty exports lookup objects that can be used like functions:\n *\n * > DOMProperty.isValid['id']\n * true\n * > DOMProperLine truncated
"Danger":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule Danger\n * @typechecks static-only\n */\n\n/*jslint evil: true, sub: true */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar createNodesFromMarkup = require(\"./createNodesFromMarkup\");\nvar emptyFunction = require(\"./emptyFunction\");\nvar getMarkupWrap = require(\"./getMarkupWrap\");\nvar invariant = require(\"./invariant\");\nvar mutateHTMLNodeWithMarkup = require(\"./mutateHTMLNodeWithMarkup\");\n\nvar OPEN_TAG_NAME_EXP = /^(<[^ \\/>]+)/;\nvar RESULT_INDEX_ATTR = 'data-danger-index';\n\n/**\n * Extracts the `nodeName` from a string of markup.\n *\n * NOTE: Extracting the `nodeName` does not require a regular expression match\n * because we make assumptions about React-generated markup (i.e. there are no\n * spaces surrounding the opening tag and there is at least one attribute).\n *\n * @param {string} markup String of markup.\n * @return {string} Node name of the supplied markup.\n * @see http://jsperf.com/extract-nodename\n */\nfunction getNodeName(markup) {\n return markup.substring(1, markup.indexOf(' '));\n}\n\nvar Danger = {\n\n /**\n * Renders markup into an array of nodes. The markup is expected to render\n * into a list of root nodes. Also, the length of `resultList` and\n * `markupList` should be the same.\n *\n * @param {array<string>} markupList List of markup strings to render.\n * @return {array<DOMElement>} List of rendered nodes.\n * @internal\n */\n dangerouslyRenderMarkup: function(markupList) {\n invariant(\n ExecutionEnvironment.canUseDOM,\n 'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' +\n 'thread. This is likely a bug in the framework. Please report ' +\n 'immediately.'\n );\n var nodeName;\n var markupByNodeName = {};\n // Group markup by `nodeName` if a wrap is necessary, else by '*'.\n for (var i = 0; i < markupList.length; i++) {\n invariant(\n markupList[i],\n 'dangerouslyRenderMarkup(...): Missing markup.'\n );\n nodeName = getNodeName(markupList[i]);\n nodeName = getMarkupWrap(nodeName) ? nodeName : '*';\n markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];\n markupByNodeName[nodeName][i] = markupList[i];\n }\n var resultList = [];\n var resultListAssignmentCount = 0;\n for (nodeName in markupByNodeName) {\n if (!markupByNodeName.hasOwnProperty(nodeName)) {\n continue;\n }\n var markupListByNodeName = markupByNodeName[nodeName];\n\n // This for-in loop skips the holes of the sparse array. The order of\n // iteration should follow the order of assignment, which happens to match\n // numerical index order, but we don't rely on that.\n for (var resultIndex in markupListByNodeName) {\n if (markupListByNodeName.hasOwnProperty(resultIndex)) {\n var markup = markupListByNodeName[resultIndex];\n\n // Push the requested markup with an additional RESULT_INDEX_ATTR\n // attribute. If the markup does not start with a < character, it\n // will be discarded below (with an appropriate console.error).\n markupListByNodeName[resultIndex] = markup.replace(\n OPEN_TAG_NAME_EXP,\n // This index will be parsed back out below.\n '$1 ' + RESULT_INDEX_ATTR + '=\"' + resultIndex + '\" '\n );\n }\n }\n\n // Render each group of markup with similar wrapping `nodeName`.\n var renderNodes = createNodesFromMarkup(\n markupListByNodeName.join(''),\n emptyFunction // Do nothing special with <script> tags.\n );\n\n for (i = 0; i < renderNodes.length; ++i) {\n var renderNode = renderNodes[i];\n if (renderNode.hasAttribute &&\n renderNode.hasAttribute(RESULT_INDEX_ATTR)) {\n\n resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);\n renderNode.removeAttribute(RESULT_INDEX_ATTR);\n\n invariant(\n !resultList.hasOwnProperty(resultIndex),\n 'Danger: Assigning to an already-occupied result index.'\n );\n\n resultList[resultIndex] = renderNode;\n\n // This should match resultList.length and markupList.length when\n // we're done.\n resultListAssignmentCount += 1;\n\n } else if (true) {\n Line truncated
"getNodeForCharacterOffset":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getNodeForCharacterOffset\n */\n\n\"use strict\";\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\nfunction getLeafNode(node) {\n while (node && node.firstChild) {\n node = node.firstChild;\n }\n return node;\n}\n\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\nfunction getSiblingNode(node) {\n while (node) {\n if (node.nextSibling) {\n return node.nextSibling;\n }\n node = node.parentNode;\n }\n}\n\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n var nodeStart = 0;\n var nodeEnd = 0;\n\n while (node) {\n if (node.nodeType == 3) {\n nodeEnd = nodeStart + node.textContent.length;\n\n if (nodeStart <= offset && nodeEnd >= offset) {\n return {\n node: node,\n offset: offset - nodeStart\n };\n }\n\n nodeStart = nodeEnd;\n }\n\n node = getLeafNode(getSiblingNode(node));\n }\n}\n\nmodule.exports = getNodeForCharacterOffset;\n\nrequire(\"./mock-modules\").register(\"getNodeForCharacterOffset\", module);\n",
"mutateHTMLNodeWithMarkup":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mutateHTMLNodeWithMarkup\n * @typechecks static-only\n */\n\n/*jslint evil: true */\n\n'use strict';\n\nvar createNodesFromMarkup = require(\"./createNodesFromMarkup\");\nvar filterAttributes = require(\"./filterAttributes\");\nvar invariant = require(\"./invariant\");\n\n/**\n * You can't set the innerHTML of a document. Unless you have\n * this function.\n *\n * @param {DOMElement} node with tagName == 'html'\n * @param {string} markup markup string including <html>.\n */\nfunction mutateHTMLNodeWithMarkup(node, markup) {\n invariant(\n node.tagName.toLowerCase() === 'html',\n 'mutateHTMLNodeWithMarkup(): node must have tagName of \"html\", got %s',\n node.tagName\n );\n\n markup = markup.trim();\n invariant(\n markup.toLowerCase().indexOf('<html') === 0,\n 'mutateHTMLNodeWithMarkup(): markup must start with <html'\n );\n\n // First let's extract the various pieces of markup.\n var htmlOpenTagEnd = markup.indexOf('>') + 1;\n var htmlCloseTagStart = markup.lastIndexOf('<');\n var htmlOpenTag = markup.substring(0, htmlOpenTagEnd);\n var innerHTML = markup.substring(htmlOpenTagEnd, htmlCloseTagStart);\n\n // Now for the fun stuff. Pass through both sets of attributes and\n // bring them up-to-date. We get the new set by creating a markup\n // fragment.\n var shouldExtractAttributes = htmlOpenTag.indexOf(' ') > -1;\n var attributeHolder = null;\n\n if (shouldExtractAttributes) {\n // We extract the attributes by creating a <span> and evaluating\n // the node.\n attributeHolder = createNodesFromMarkup(\n htmlOpenTag.replace('html ', 'span ') + '</span>'\n )[0];\n\n // Add all attributes present in attributeHolder\n var attributesToSet = filterAttributes(\n attributeHolder,\n function(attr) {\n return node.getAttributeNS(attr.namespaceURI, attr.name) !== attr.value;\n }\n );\n attributesToSet.forEach(function(attr) {\n node.setAttributeNS(attr.namespaceURI, attr.name, attr.value);\n });\n }\n\n // Remove all attributes not present in attributeHolder\n var attributesToRemove = filterAttributes(\n node,\n function(attr) {\n // Remove all attributes if attributeHolder is null or if it does not have\n // the desired attribute.\n return !(\n attributeHolder &&\n attributeHolder.hasAttributeNS(attr.namespaceURI, attr.name)\n );\n }\n );\n attributesToRemove.forEach(function(attr) {\n node.removeAttributeNS(attr.namespaceURI, attr.name);\n });\n\n // Finally, set the inner HTML. No tricks needed. Do this last to\n // minimize likelihood of triggering reflows.\n node.innerHTML = innerHTML;\n}\n\nmodule.exports = mutateHTMLNodeWithMarkup;\n\nrequire(\"./mock-modules\").register(\"mutateHTMLNodeWithMarkup\", module);\n",
"emptyFunction":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule emptyFunction\n */\n\nvar copyProperties = require(\"./copyProperties\");\n\nfunction makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nfunction emptyFunction() {}\n\ncopyProperties(emptyFunction, {\n thatReturns: makeEmptyFunction,\n thatReturnsFalse: makeEmptyFunction(false),\n thatReturnsTrue: makeEmptyFunction(true),\n thatReturnsNull: makeEmptyFunction(null),\n thatReturnsThis: function() { return this; },\n thatReturnsArgument: function(arg) { return arg; }\n});\n\nmodule.exports = emptyFunction;\n\nrequire(\"./mock-modules\").register(\"emptyFunction\", module);\n",
"ExecutionEnvironment":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ExecutionEnvironment\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar canUseDOM = typeof window !== 'undefined';\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n canUseDOM: canUseDOM,\n\n canUseWorkers: typeof Worker !== 'undefined',\n\n isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nmodule.exports = ExecutionEnvironment;\n\nrequire(\"./mock-modules\").register(\"ExecutionEnvironment\", module);\n",
"ReactServerRendering":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @typechecks static-only\n * @providesModule ReactServerRendering\n */\n\"use strict\";\n\nvar ReactMarkupChecksum = require(\"./ReactMarkupChecksum\");\nvar ReactReconcileTransaction = require(\"./ReactReconcileTransaction\");\nvar ReactInstanceHandles = require(\"./ReactInstanceHandles\");\n\n/**\n * @param {object} component\n * @param {function} callback\n */\nfunction renderComponentToString(component, callback) {\n // We use a callback API to keep the API async in case in the future we ever\n // need it, but in reality this is a synchronous operation.\n var id = ReactInstanceHandles.createReactRootID();\n var transaction = ReactReconcileTransaction.getPooled();\n transaction.reinitializeTransaction();\n try {\n transaction.perform(function() {\n var markup = component.mountComponent(id, transaction, 0);\n markup = ReactMarkupChecksum.addChecksumToMarkup(markup);\n callback(markup);\n }, null);\n } finally {\n ReactReconcileTransaction.release(transaction);\n }\n}\n\nmodule.exports = {\n renderComponentToString: renderComponentToString\n};\n\nrequire(\"./mock-modules\").register(\"ReactServerRendering\", module);\n",
"ReactMarkupChecksum":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactMarkupChecksum\n */\n\n\"use strict\";\n\nvar adler32 = require(\"./adler32\");\n\nvar ReactMarkupChecksum = {\n CHECKSUM_ATTR_NAME: 'data-react-checksum',\n\n /**\n * @param {string} markup Markup string\n * @return {string} Markup string with checksum attribute attached\n */\n addChecksumToMarkup: function(markup) {\n var checksum = adler32(markup);\n return markup.replace(\n '>',\n ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '=\"' + checksum + '\">'\n );\n },\n\n /**\n * @param {string} markup to use\n * @param {DOMElement} element root React element\n * @returns {boolean} whether or not the markup is the same\n */\n canReuseMarkup: function(markup, element) {\n var existingChecksum = element.getAttribute(\n ReactMarkupChecksum.CHECKSUM_ATTR_NAME\n );\n existingChecksum = existingChecksum && parseInt(existingChecksum, 10);\n var markupChecksum = adler32(markup);\n return markupChecksum === existingChecksum;\n }\n};\n\nmodule.exports = ReactMarkupChecksum;\n\nrequire(\"./mock-modules\").register(\"ReactMarkupChecksum\", module);\n",
"merge":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule merge\n */\n\n\"use strict\";\n\nvar mergeInto = require(\"./mergeInto\");\n\n/**\n * Shallow merges two structures into a return value, without mutating either.\n *\n * @param {?object} one Optional object with properties to merge from.\n * @param {?object} two Optional object with properties to merge from.\n * @return {object} The shallow extension of one by two.\n */\nvar merge = function(one, two) {\n var result = {};\n mergeInto(result, one);\n mergeInto(result, two);\n return result;\n};\n\nmodule.exports = merge;\n\nrequire(\"./mock-modules\").register(\"merge\", module);\n",
"EventPluginRegistry":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventPluginRegistry\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Injectable ordering of event plugins.\n */\nvar EventPluginOrder = null;\n\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering() {\n if (!EventPluginOrder) {\n // Wait until an `EventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var PluginModule = namesToPlugins[pluginName];\n var pluginIndex = EventPluginOrder.indexOf(pluginName);\n invariant(\n pluginIndex > -1,\n 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' +\n 'the plugin ordering, `%s`.',\n pluginName\n );\n if (EventPluginRegistry.plugins[pluginIndex]) {\n continue;\n }\n invariant(\n PluginModule.extractEvents,\n 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' +\n 'method, but `%s` does not.',\n pluginName\n );\n EventPluginRegistry.plugins[pluginIndex] = PluginModule;\n var publishedEvents = PluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n invariant(\n publishEventForPlugin(publishedEvents[eventName], PluginModule),\n 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',\n eventName,\n pluginName\n );\n }\n }\n}\n\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\nfunction publishEventForPlugin(dispatchConfig, PluginModule) {\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, PluginModule);\n }\n }\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, PluginModule);\n return true;\n }\n return false;\n}\n\n/**\n * Publishes a registration name that is used to identify dispatched events and\n * can be used with `EventPluginHub.putListener` to register listeners.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\nfunction publishRegistrationName(registrationName, PluginModule) {\n invariant(\n !EventPluginRegistry.registrationNames[registrationName],\n 'EventPluginHub: More than one plugin attempted to publish the same ' +\n 'registration name, `%s`.',\n registrationName\n );\n EventPluginRegistry.registrationNames[registrationName] = PluginModule;\n EventPluginRegistry.registrationNamesKeys.push(registrationName);\n}\n\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\nvar EventPluginRegistry = {\n\n /**\n * Ordered list of injected plugins.\n */\n plugins: [],\n\n /**\n * Mapping from registration names to plugin modules.\n */\n registrationNames: {},\n\n /**\n * The keys of `registrationNames`.\n */\n registrationNamesKeys: [],\n\n /**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\n injectEventPluginOrder: function(InjectedEventPluginOrder) {\n invariant(\n !EventPluginOrder,\n 'EventPluginRegistry: Cannot inject event plugin ordering more than once.'\n );\n // Clone the ordering so it cannot be dynamically mutated.\n EventPluginOrder = Array.prototype.slice.call(InjectedEventPlu Line truncated
"SyntheticEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar PooledClass = require(\"./PooledClass\");\n\nvar emptyFunction = require(\"./emptyFunction\");\nvar getEventTarget = require(\"./getEventTarget\");\nvar merge = require(\"./merge\");\nvar mergeInto = require(\"./mergeInto\");\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n type: null,\n target: getEventTarget,\n currentTarget: null,\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function(event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n */\nfunction SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n this.dispatchConfig = dispatchConfig;\n this.dispatchMarker = dispatchMarker;\n this.nativeEvent = nativeEvent;\n\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n var normalize = Interface[propName];\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n\n if (nativeEvent.defaultPrevented || nativeEvent.returnValue === false) {\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n } else {\n this.isDefaultPrevented = emptyFunction.thatReturnsFalse;\n }\n this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n}\n\nmergeInto(SyntheticEvent.prototype, {\n\n preventDefault: function() {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n event.preventDefault ? event.preventDefault() : event.returnValue = false;\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n },\n\n stopPropagation: function() {\n var event = this.nativeEvent;\n event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;\n this.isPropagationStopped = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function() {\n this.isPersistent = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: emptyFunction.thatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function() {\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n this[propName] = null;\n }\n this.dispatchConfig = null;\n this.dispatchMarker = null;\n this.nativeEvent = null;\n }\n\n});\n\nSyntheticEvent.Interface = EventInterface;\n\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function(Class, Interface) {\n var Super = this;\n\n var prototype = Object.create(Super.prototype);\n mergeInto(prototype, Class.prototype);\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n\n Class.Interface = merge(Super.Interface, Interface);\n Class.augmentClass = Super.augmentClass;\n\n PooledClass.addPoolingTo(Class, PooledClass.threeArgumentPooler);\n};\Line truncated
"SyntheticWheelEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticWheelEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticMouseEvent = require(\"./SyntheticMouseEvent\");\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar WheelEventInterface = {\n deltaX: function(event) {\n // NOTE: IE<9 does not support x-axis delta.\n return (\n 'deltaX' in event ? event.deltaX :\n // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0\n );\n },\n deltaY: function(event) {\n return (\n // Normalize (up is positive).\n 'deltaY' in event ? -event.deltaY :\n // Fallback to `wheelDeltaY` for Webkit.\n 'wheelDeltaY' in event ? event.wheelDeltaY :\n // Fallback to `wheelDelta` for IE<9.\n 'wheelDelta' in event ? event.wheelData : 0\n );\n },\n deltaZ: null,\n deltaMode: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticMouseEvent}\n */\nfunction SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);\n\nmodule.exports = SyntheticWheelEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticWheelEvent\", module);\n",
"AnalyticsEventPluginFactory":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule AnalyticsEventPluginFactory\n *\n * This module provides a factory method to create the AnalyticsEventPlugin that\n * can be used to track the usage of React components that are of interest to\n * the user.\n *\n * In order to enable a component for analytics tracking, you need to specify\n * two additional attributes to the component when you describe the structure of\n * your component in the render() method:\n *\n * 1. 'data-analytics-id': This represents a unique ID that the analytics module\n * will use to identify this component in all the analytics data. Note that\n * this is independent of the ref or the DOM id of the element. Over the\n * lifetime of the product, even if the component id or ref needs to be\n * changed, as long as you can ensure the analytics ID doesnt change, the\n * historical data can be correlated. Also note that React does NOT do\n * anything to guarantee or enforce uniqueness of this ID. If its not unique\n * the analytics data reported will be incorrect.\n *\n * 2. 'data-analytics-events': This is a comma separated list of DOM events that\n * you want analytics on. React currently supports tracking only on a\n * distinct set of events (See topLevelTypesToAnalyticsEvent).\n * If the list contains an event that React does not recognize for analytics\n * tracking, in __DEV__, an error will be thrown. Note that it is case\n * sensitive and space sensitive.\n *\n * By default the AnalyticsEventPlugin is NOT enabled in React. To use it, you\n * need to create the plugin using the factory method and add it to the list of\n * Plugins maintained in the EventPluginHub before your component is rendered.\n * As creation parameters you can specify two arguments:\n *\n * 1. callback: This is a required parameter. In __DEV__, an error will be\n * thrown if this param is missing. The callback will be called with the\n * analyticsData as an argument. The analyticsData will contain one property\n * per every React component, identified by its data-analytics-id. The value\n * of this property will be an object containing properties corresponding to\n * each of the comma separated events specified in data-analytics-events.\n *\n * For example, if you have:\n * <Button ...\n * data-analytics-id=\"createButton\"\n * data-analytics-events=\"click\"\n * />\n * and\n * <TextBox ...\n * data-analytics-id=\"disclaimerBox\"\n * data-analytics-events=\"focus,scroll\"\n * />\n * analyticsData will be something like:\n * '{\"createButton\":{\"click\":50}, \"disclaimerBox\":{\"focus\":15, \"scroll\":5}}'\n *\n * DO NOT mutate the data that you get in the callback. Mutating it will lead\n * to errors and unstable behavior.\n *\n * The React component will be included for analytics as long as some user\n * interaction has happened with that component. If no user interaction has\n * happened with any of the components tracked for analytics, the callback\n * will not be called.\n *\n * 2. interval (in milliseconds): This is an optional parameter to specify the\n * interval at which the callback needs to be called. It needs to be greater\n * than the 2 minutes (which is the default value if this parameter is not\n * specified or a value less than 2 minutes is specified)\n *\n * Please refer to the unit tests AnalyticsEventPlugin-test.js for details on\n * usage.\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar emptyFunction = require(\"./emptyFunction\");\nvar invariant = require(\"./invariant\");\nvar topLevelTypes = require(\"./EventConstants\").topLevelTypes;\n\nvar ANALYTICS_ID = 'data-analytics-id';\nvar ANALYTICS_EVENTS = 'data-analytics-events';\nvar DEFAULT_INTERVAL_MS = 2 * 60 * 1000; // 2 minutes\n\nvar analyticsData = {};\n\n// List of topLevel event types that React supports for analytics tracking\nvar topLevelTypesToAnalyticsEvent = {\n topClick: 'click',\n topDoubleClick: 'doubleClick',\n wheel: 'wheel',\n topTouchStart: 'touchStart',\n topTouchEnd: 'touchEnd',\n topTouchMove: 'touchMove',\n topTouchCancel: 'touchCancel',\n topKeyUp: 'keyUp',\n topKeyPress: 'keyPress',\n topKeyDown: 'keyDown',\n topFocus: 'focus',\n Line truncated
"DefaultEventPluginOrder":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule DefaultEventPluginOrder\n */\n\n\"use strict\";\n\n var keyOf = require(\"./keyOf\");\n\n/**\n * Module that is injectable into `EventPluginHub`, that specifies a\n * deterministic ordering of `EventPlugin`s. A convenient way to reason about\n * plugins, without having to package every one of them. This is better than\n * having plugins be ordered in the same order that they are injected because\n * that ordering would be influenced by the packaging order.\n * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that\n * preventing default on events is convenient in `SimpleEventPlugin` handlers.\n */\nvar DefaultEventPluginOrder = [\n keyOf({ResponderEventPlugin: null}),\n keyOf({SimpleEventPlugin: null}),\n keyOf({TapEventPlugin: null}),\n keyOf({EnterLeaveEventPlugin: null}),\n keyOf({ChangeEventPlugin: null}),\n keyOf({SelectEventPlugin: null}),\n keyOf({CompositionEventPlugin: null}),\n keyOf({AnalyticsEventPlugin: null}),\n keyOf({MobileSafariClickEventPlugin: null})\n];\n\nmodule.exports = DefaultEventPluginOrder;\n\nrequire(\"./mock-modules\").register(\"DefaultEventPluginOrder\", module);\n",
"EnterLeaveEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EnterLeaveEventPlugin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar SyntheticMouseEvent = require(\"./SyntheticMouseEvent\");\n\nvar ReactMount = require(\"./ReactMount\");\nvar keyOf = require(\"./keyOf\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\nvar getFirstReactDOM = ReactMount.getFirstReactDOM;\n\nvar eventTypes = {\n mouseEnter: {registrationName: keyOf({onMouseEnter: null})},\n mouseLeave: {registrationName: keyOf({onMouseLeave: null})}\n};\n\nvar extractedEvents = [null, null];\n\nvar EnterLeaveEventPlugin = {\n\n eventTypes: eventTypes,\n\n /**\n * For almost every interaction we care about, there will be both a top-level\n * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a `mouseout` event. In this case, we use\n * the `mouseover` top-level event.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {*} An accumulation of synthetic events.\n * @see {EventPluginHub.extractEvents}\n */\n extractEvents: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent) {\n if (topLevelType === topLevelTypes.topMouseOver &&\n (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n return null;\n }\n if (topLevelType !== topLevelTypes.topMouseOut &&\n topLevelType !== topLevelTypes.topMouseOver) {\n // Must not be a mouse in or mouse out - ignoring.\n return null;\n }\n\n var from, to;\n if (topLevelType === topLevelTypes.topMouseOut) {\n from = topLevelTarget;\n to =\n getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement) ||\n window;\n } else {\n from = window;\n to = topLevelTarget;\n }\n\n if (from === to) {\n // Nothing pertains to our managed components.\n return null;\n }\n\n var fromID = from ? ReactMount.getID(from) : '';\n var toID = to ? ReactMount.getID(to) : '';\n\n var leave = SyntheticMouseEvent.getPooled(\n eventTypes.mouseLeave,\n fromID,\n nativeEvent\n );\n var enter = SyntheticMouseEvent.getPooled(\n eventTypes.mouseEnter,\n toID,\n nativeEvent\n );\n\n EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);\n\n extractedEvents[0] = leave;\n extractedEvents[1] = enter;\n\n return extractedEvents;\n }\n\n};\n\nmodule.exports = EnterLeaveEventPlugin;\n\nrequire(\"./mock-modules\").register(\"EnterLeaveEventPlugin\", module);\n",
"ChangeEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ChangeEventPlugin\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPluginHub = require(\"./EventPluginHub\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\nvar isEventSupported = require(\"./isEventSupported\");\nvar isTextInputElement = require(\"./isTextInputElement\");\nvar keyOf = require(\"./keyOf\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n change: {\n phasedRegistrationNames: {\n bubbled: keyOf({onChange: null}),\n captured: keyOf({onChangeCapture: null})\n }\n }\n};\n\n/**\n * For IE shims\n */\nvar activeElement = null;\nvar activeElementID = null;\nvar activeElementValue = null;\nvar activeElementValueProp = null;\n\n/**\n * SECTION: handle `change` event\n */\nfunction shouldUseChangeEvent(elem) {\n return (\n elem.nodeName === 'SELECT' ||\n (elem.nodeName === 'INPUT' && elem.type === 'file')\n );\n}\n\nvar doesChangeEventBubble = false;\nif (ExecutionEnvironment.canUseDOM) {\n // See `handleChange` comment below\n doesChangeEventBubble = isEventSupported('change') && (\n !('documentMode' in document) || document.documentMode > 8\n );\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n var event = SyntheticEvent.getPooled(\n eventTypes.change,\n activeElementID,\n nativeEvent\n );\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n // If change bubbled, we'd just bind to it like all the other events\n // and have it go through ReactEventTopLevelCallback. Since it doesn't, we\n // manually listen for the change event and so we have to enqueue and\n // process the abstract event manually.\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n}\n\nfunction startWatchingForChangeEventIE8(target, targetID) {\n activeElement = target;\n activeElementID = targetID;\n activeElement.attachEvent('onchange', manualDispatchChangeEvent);\n}\n\nfunction stopWatchingForChangeEventIE8() {\n if (!activeElement) {\n return;\n }\n activeElement.detachEvent('onchange', manualDispatchChangeEvent);\n activeElement = null;\n activeElementID = null;\n}\n\nfunction getTargetIDForChangeEvent(\n topLevelType,\n topLevelTarget,\n topLevelTargetID) {\n if (topLevelType === topLevelTypes.topChange) {\n return topLevelTargetID;\n }\n}\nfunction handleEventsForChangeEventIE8(\n topLevelType,\n topLevelTarget,\n topLevelTargetID) {\n if (topLevelType === topLevelTypes.topFocus) {\n // stopWatching() should be a noop here but we call it just in case we\n // missed a blur event somehow.\n stopWatchingForChangeEventIE8();\n startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);\n } else if (topLevelType === topLevelTypes.topBlur) {\n stopWatchingForChangeEventIE8();\n }\n}\n\n\n/**\n * SECTION: handle `input` event\n */\nvar isInputEventSupported = false;\nif (ExecutionEnvironment.canUseDOM) {\n // IE9 claims to support the input event but fails to trigger it when\n // deleting text, so we ignore its input events\n isInputEventSupported = isEventSupported('input') && (\n !('documentMode' in document) || document.documentMode > 9\n );\n}\n\n/**\n * (For old IE.) Replacement getter/setter for the `value` property that gets\n * set on the active element.\n */\nvar newValueProp = {\n get: function() {\n return activeElementValueProp.get.call(this);\n },\n set: function(val) {\n // Cast to a string so we can do equality checks.\n activeElementValue = '' + val;\n activeElementValueProp.set.call(this, val);\n }\n};\n\n/**\n * (For old IE.) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\nfunction startWatchingForValueChange(target, targetID) {\n activeElement = target;\n activeElementID = targetID;\n activeElementValue = target.value;\n activeElementValueProp = Object.getOwnPropertyDescriptor(\n target.constructor.prototype,\n 'value'\n );\n\n Object.defineProperty(activeElement, 'value', newValueProp);\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n\n/**\n * Line truncated
"SimpleEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SimpleEventPlugin\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar SyntheticClipboardEvent = require(\"./SyntheticClipboardEvent\");\nvar SyntheticEvent = require(\"./SyntheticEvent\");\nvar SyntheticFocusEvent = require(\"./SyntheticFocusEvent\");\nvar SyntheticKeyboardEvent = require(\"./SyntheticKeyboardEvent\");\nvar SyntheticMouseEvent = require(\"./SyntheticMouseEvent\");\nvar SyntheticTouchEvent = require(\"./SyntheticTouchEvent\");\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\nvar SyntheticWheelEvent = require(\"./SyntheticWheelEvent\");\n\nvar invariant = require(\"./invariant\");\nvar keyOf = require(\"./keyOf\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n blur: {\n phasedRegistrationNames: {\n bubbled: keyOf({onBlur: true}),\n captured: keyOf({onBlurCapture: true})\n }\n },\n click: {\n phasedRegistrationNames: {\n bubbled: keyOf({onClick: true}),\n captured: keyOf({onClickCapture: true})\n }\n },\n copy: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCopy: true}),\n captured: keyOf({onCopyCapture: true})\n }\n },\n cut: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCut: true}),\n captured: keyOf({onCutCapture: true})\n }\n },\n doubleClick: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDoubleClick: true}),\n captured: keyOf({onDoubleClickCapture: true})\n }\n },\n drag: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDrag: true}),\n captured: keyOf({onDragCapture: true})\n }\n },\n dragEnd: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragEnd: true}),\n captured: keyOf({onDragEndCapture: true})\n }\n },\n dragEnter: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragEnter: true}),\n captured: keyOf({onDragEnterCapture: true})\n }\n },\n dragExit: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragExit: true}),\n captured: keyOf({onDragExitCapture: true})\n }\n },\n dragLeave: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragLeave: true}),\n captured: keyOf({onDragLeaveCapture: true})\n }\n },\n dragOver: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragOver: true}),\n captured: keyOf({onDragOverCapture: true})\n }\n },\n dragStart: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDragStart: true}),\n captured: keyOf({onDragStartCapture: true})\n }\n },\n drop: {\n phasedRegistrationNames: {\n bubbled: keyOf({onDrop: true}),\n captured: keyOf({onDropCapture: true})\n }\n },\n focus: {\n phasedRegistrationNames: {\n bubbled: keyOf({onFocus: true}),\n captured: keyOf({onFocusCapture: true})\n }\n },\n input: {\n phasedRegistrationNames: {\n bubbled: keyOf({onInput: true}),\n captured: keyOf({onInputCapture: true})\n }\n },\n keyDown: {\n phasedRegistrationNames: {\n bubbled: keyOf({onKeyDown: true}),\n captured: keyOf({onKeyDownCapture: true})\n }\n },\n keyPress: {\n phasedRegistrationNames: {\n bubbled: keyOf({onKeyPress: true}),\n captured: keyOf({onKeyPressCapture: true})\n }\n },\n keyUp: {\n phasedRegistrationNames: {\n bubbled: keyOf({onKeyUp: true}),\n captured: keyOf({onKeyUpCapture: true})\n }\n },\n // Note: We do not allow listening to mouseOver events. Instead, use the\n // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.\n mouseDown: {\n phasedRegistrationNames: {\n bubbled: keyOf({onMouseDown: true}),\n captured: keyOf({onMouseDownCapture: true})\n }\n },\n mouseMove: {\n phasedRegistrationNames: {\n bubbled: keyOf({onMouseMove: true}),\n captured: keyOf({onMouseMoveCapture: true})\n }\n },\n mouseUp: {\n phasedRegistrationNames: {\n bubbled: keyOf({onMouseUp: true}),\n captured: keyOf({onMouseUpCapture: true})\n }\n },\n paste: {\n phasedRegistrationNames: {\n bubbled: keyOf({onPaste: true}),\n captured: keyOf({onPasteCapture: true})\n }\n },\n scroll: {\n phasedRegistrationNames: {\n bubbled: keyOf({onScroll: true}),\n captured: keyOf({onScroll Line truncated
"CallbackRegistry":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule CallbackRegistry\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar listenerBank = {};\n\n/**\n * Stores \"listeners\" by `registrationName`/`id`. There should be at most one\n * \"listener\" per `registrationName`/`id` in the `listenerBank`.\n *\n * Access listeners via `listenerBank[registrationName][id]`.\n *\n * @class CallbackRegistry\n * @internal\n */\nvar CallbackRegistry = {\n\n /**\n * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.\n *\n * @param {string} id ID of the DOM element.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {?function} listener The callback to store.\n */\n putListener: function(id, registrationName, listener) {\n var bankForRegistrationName =\n listenerBank[registrationName] || (listenerBank[registrationName] = {});\n bankForRegistrationName[id] = listener;\n },\n\n /**\n * @param {string} id ID of the DOM element.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n getListener: function(id, registrationName) {\n var bankForRegistrationName = listenerBank[registrationName];\n return bankForRegistrationName && bankForRegistrationName[id];\n },\n\n /**\n * Deletes a listener from the registration bank.\n *\n * @param {string} id ID of the DOM element.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n */\n deleteListener: function(id, registrationName) {\n var bankForRegistrationName = listenerBank[registrationName];\n if (bankForRegistrationName) {\n delete bankForRegistrationName[id];\n }\n },\n\n /**\n * Deletes all listeners for the DOM element with the supplied ID.\n *\n * @param {string} id ID of the DOM element.\n */\n deleteAllListeners: function(id) {\n for (var registrationName in listenerBank) {\n delete listenerBank[registrationName][id];\n }\n },\n\n /**\n * This is needed for tests only. Do not use!\n */\n __purge: function() {\n listenerBank = {};\n }\n\n};\n\nmodule.exports = CallbackRegistry;\n\nrequire(\"./mock-modules\").register(\"CallbackRegistry\", module);\n",
"EventConstants":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventConstants\n */\n\n\"use strict\";\n\nvar keyMirror = require(\"./keyMirror\");\n\nvar PropagationPhases = keyMirror({bubbled: null, captured: null});\n\n/**\n * Types of raw signals from the browser caught at the top level.\n */\nvar topLevelTypes = keyMirror({\n topBlur: null,\n topChange: null,\n topClick: null,\n topCompositionEnd: null,\n topCompositionStart: null,\n topCompositionUpdate: null,\n topCopy: null,\n topCut: null,\n topDoubleClick: null,\n topDrag: null,\n topDragEnd: null,\n topDragEnter: null,\n topDragExit: null,\n topDragLeave: null,\n topDragOver: null,\n topDragStart: null,\n topDrop: null,\n topFocus: null,\n topInput: null,\n topKeyDown: null,\n topKeyPress: null,\n topKeyUp: null,\n topMouseDown: null,\n topMouseMove: null,\n topMouseOut: null,\n topMouseOver: null,\n topMouseUp: null,\n topPaste: null,\n topScroll: null,\n topSelectionChange: null,\n topSubmit: null,\n topTouchCancel: null,\n topTouchEnd: null,\n topTouchMove: null,\n topTouchStart: null,\n topWheel: null\n});\n\nvar EventConstants = {\n topLevelTypes: topLevelTypes,\n PropagationPhases: PropagationPhases\n};\n\nmodule.exports = EventConstants;\n\nrequire(\"./mock-modules\").register(\"EventConstants\", module);\n",
"EventPropagators":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventPropagators\n */\n\n\"use strict\";\n\nvar CallbackRegistry = require(\"./CallbackRegistry\");\nvar EventConstants = require(\"./EventConstants\");\n\nvar accumulate = require(\"./accumulate\");\nvar forEachAccumulated = require(\"./forEachAccumulated\");\nvar getListener = CallbackRegistry.getListener;\nvar PropagationPhases = EventConstants.PropagationPhases;\n\n/**\n * Injected dependencies:\n */\n\n/**\n * - `InstanceHandle`: [required] Module that performs logical traversals of DOM\n * hierarchy given ids of the logical DOM elements involved.\n */\nvar injection = {\n InstanceHandle: null,\n injectInstanceHandle: function(InjectedInstanceHandle) {\n injection.InstanceHandle = InjectedInstanceHandle;\n if (true) {\n injection.validate();\n }\n },\n validate: function() {\n var invalid = !injection.InstanceHandle||\n !injection.InstanceHandle.traverseTwoPhase ||\n !injection.InstanceHandle.traverseEnterLeave;\n if (invalid) {\n throw new Error('InstanceHandle not injected before use!');\n }\n }\n};\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(id, event, propagationPhase) {\n var registrationName =\n event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(id, registrationName);\n}\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\nfunction accumulateDirectionalDispatches(domID, upwards, event) {\n if (true) {\n if (!domID) {\n throw new Error('Dispatching id must not be null');\n }\n injection.validate();\n }\n var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;\n var listener = listenerAtPhase(domID, event, phase);\n if (listener) {\n event._dispatchListeners = accumulate(event._dispatchListeners, listener);\n event._dispatchIDs = accumulate(event._dispatchIDs, domID);\n }\n}\n\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory. We must loop through\n * each event and perform the traversal for each one. We can not perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n injection.InstanceHandle.traverseTwoPhase(\n event.dispatchMarker,\n accumulateDirectionalDispatches,\n event\n );\n }\n}\n\n\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\nfunction accumulateDispatches(id, ignoredDirection, event) {\n if (event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(id, registrationName);\n if (listener) {\n event._dispatchListeners = accumulate(event._dispatchListeners, listener);\n event._dispatchIDs = accumulate(event._dispatchIDs, id);\n }\n }\n}\n\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\nfunction accumulateDirectDispatchesSingle(event) {\n if (event && event.dispatchConfig.registrationName) {\n accumulateDispatches(event.dispatchMarker, null, event);\n }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n if (true) {\n injection.validate();\n }\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {\n if (true) {\n injection.validate();\n }\n injection.InstanceHandle.traverseEnterLeave(\n fromID,\n toID,\n accumulateDispatches,\n leave,\n enter\n );\n}\n\n\nfunction accumulateDirectDispatches(events) {\n if (true) {\n injection.validaLine truncated
"ResponderEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ResponderEventPlugin\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPluginUtils = require(\"./EventPluginUtils\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\nvar accumulate = require(\"./accumulate\");\nvar keyOf = require(\"./keyOf\");\n\nvar isStartish = EventPluginUtils.isStartish;\nvar isMoveish = EventPluginUtils.isMoveish;\nvar isEndish = EventPluginUtils.isEndish;\nvar executeDirectDispatch = EventPluginUtils.executeDirectDispatch;\nvar hasDispatches = EventPluginUtils.hasDispatches;\nvar executeDispatchesInOrderStopAtTrue =\n EventPluginUtils.executeDispatchesInOrderStopAtTrue;\n\n/**\n * ID of element that should respond to touch/move types of interactions, as\n * indicated explicitly by relevant callbacks.\n */\nvar responderID = null;\nvar isPressing = false;\n\nvar eventTypes = {\n /**\n * On a `touchStart`/`mouseDown`, is it desired that this element become the\n * responder?\n */\n startShouldSetResponder: {\n phasedRegistrationNames: {\n bubbled: keyOf({onStartShouldSetResponder: null}),\n captured: keyOf({onStartShouldSetResponderCapture: null})\n }\n },\n\n /**\n * On a `scroll`, is it desired that this element become the responder? This\n * is usually not needed, but should be used to retroactively infer that a\n * `touchStart` had occured during momentum scroll. During a momentum scroll,\n * a touch start will be immediately followed by a scroll event if the view is\n * currently scrolling.\n */\n scrollShouldSetResponder: {\n phasedRegistrationNames: {\n bubbled: keyOf({onScrollShouldSetResponder: null}),\n captured: keyOf({onScrollShouldSetResponderCapture: null})\n }\n },\n\n /**\n * On a `touchMove`/`mouseMove`, is it desired that this element become the\n * responder?\n */\n moveShouldSetResponder: {\n phasedRegistrationNames: {\n bubbled: keyOf({onMoveShouldSetResponder: null}),\n captured: keyOf({onMoveShouldSetResponderCapture: null})\n }\n },\n\n /**\n * Direct responder events dispatched directly to responder. Do not bubble.\n */\n responderMove: {registrationName: keyOf({onResponderMove: null})},\n responderRelease: {registrationName: keyOf({onResponderRelease: null})},\n responderTerminationRequest: {\n registrationName: keyOf({onResponderTerminationRequest: null})\n },\n responderGrant: {registrationName: keyOf({onResponderGrant: null})},\n responderReject: {registrationName: keyOf({onResponderReject: null})},\n responderTerminate: {registrationName: keyOf({onResponderTerminate: null})}\n};\n\n/**\n * Performs negotiation between any existing/current responder, checks to see if\n * any new entity is interested in becoming responder, performs that handshake\n * and returns any events that must be emitted to notify the relevant parties.\n *\n * A note about event ordering in the `EventPluginHub`.\n *\n * Suppose plugins are injected in the following order:\n *\n * `[R, S, C]`\n *\n * To help illustrate the example, assume `S` is `SimpleEventPlugin` (for\n * `onClick` etc) and `R` is `ResponderEventPlugin`.\n *\n * \"Deferred-Dispatched Events\":\n *\n * - The current event plugin system will traverse the list of injected plugins,\n * in order, and extract events by collecting the plugin's return value of\n * `extractEvents()`.\n * - These events that are returned from `extractEvents` are \"deferred\n * dispatched events\".\n * - When returned from `extractEvents`, deferred-dispatched events contain an\n * \"accumulation\" of deferred dispatches.\n * - These deferred dispatches are accumulated/collected before they are\n * returned, but processed at a later time by the `EventPluginHub` (hence the\n * name deferred).\n *\n * In the process of returning their deferred-dispatched events, event plugins\n * themselves can dispatch events on-demand without returning them from\n * `extractEvents`. Plugins might want to do this, so that they can use event\n * dispatching as a tool that helps them decide which events should be extracted\n * in the first place.\n *\n * \"On-Demand-Dispatched Events\":\n *\n * - On-demand-dispatched events are not returned from `extractEvents`.\n * - On-demand-dispatched events are dispatched duLine truncated
"ImmutableObject":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ImmutableObject\n * @typechecks\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\nvar isNode = require(\"./isNode\");\nvar merge = require(\"./merge\");\nvar mergeInto = require(\"./mergeInto\");\nvar mergeHelpers = require(\"./mergeHelpers\");\n\nvar checkMergeObjectArgs = mergeHelpers.checkMergeObjectArgs;\nvar isTerminal = mergeHelpers.isTerminal;\n\n/**\n * Wrapper around JavaScript objects that provide a guarantee of immutability at\n * developer time when strict mode is used. The extra computations required to\n * enforce immutability is stripped out in production for performance reasons.\n */\nvar ImmutableObject;\n\nfunction assertImmutableObject(immutableObject) {\n invariant(\n immutableObject instanceof ImmutableObject,\n 'ImmutableObject: Attempted to set fields on an object that is not an ' +\n 'instance of ImmutableObject.'\n );\n}\n\nif (true) {\n /**\n * Constructs an instance of `ImmutableObject`.\n *\n * @param {?object} initialProperties The initial set of properties.\n * @constructor\n */\n ImmutableObject = function ImmutableObject(initialProperties) {\n mergeInto(this, initialProperties);\n deepFreeze(this);\n };\n\n /**\n * Checks if an object should be deep frozen. Instances of `ImmutableObject`\n * are assumed to have already been deep frozen.\n *\n * @param {*} object The object to check.\n * @return {boolean} Whether or not deep freeze is needed.\n */\n var shouldRecurseFreeze = function(object) {\n return (\n typeof object === 'object' &&\n !(object instanceof ImmutableObject) &&\n object !== null\n );\n };\n\n /**\n * Freezes the supplied object deeply.\n *\n * @param {*} object The object to freeze.\n */\n var deepFreeze = function(object) {\n if (isNode(object)) {\n return; // Don't try to freeze DOM nodes.\n }\n Object.freeze(object); // First freeze the object.\n for (var prop in object) {\n var field = object[prop];\n if (object.hasOwnProperty(prop) && shouldRecurseFreeze(field)) {\n deepFreeze(field);\n }\n }\n };\n\n /**\n * Returns a new ImmutableObject that is identical to the supplied object but\n * with the supplied changes, `put`.\n *\n * @param {ImmutableObject} immutableObject Starting object.\n * @param {?object} put Fields to merge into the object.\n * @return {ImmutableObject} The result of merging in `put` fields.\n */\n ImmutableObject.set = function(immutableObject, put) {\n assertImmutableObject(immutableObject);\n var totalNewFields = merge(immutableObject, put);\n return new ImmutableObject(totalNewFields);\n };\n\n}\n\n/**\n * Sugar for `ImmutableObject.set(ImmutableObject, {fieldName: putField})`.\n *\n * @param {ImmutableObject} immutableObject Object on which to set field.\n * @param {string} fieldName Name of the field to set.\n * @param {*} putField Value of the field to set.\n * @return {ImmutableObject} [description]\n */\nImmutableObject.setField = function(immutableObject, fieldName, putField) {\n var put = {};\n put[fieldName] = putField;\n return ImmutableObject.set(immutableObject, put);\n};\n\n/**\n * Returns a new ImmutableObject that is identical to the supplied object but\n * with the supplied changes recursively applied.\n *\n * @param {ImmutableObject} immutableObject Object on which to set fields.\n * @param {object} put Fields to merge into the object.\n * @return {ImmutableObject} The result of merging in `put` fields.\n */\nImmutableObject.setDeep = function(immutableObject, put) {\n assertImmutableObject(immutableObject);\n return _setDeep(immutableObject, put);\n};\n\nfunction _setDeep(object, put) {\n checkMergeObjectArgs(object, put);\n var totalNewFields = {};\n\n // To maintain the order of the keys, copy the base object's entries first.\n var keys = Object.keys(object);\n for (var ii = 0; ii < keys.length; ii++) {\n var key = keys[ii];\n if (!put.hasOwnProperty(key)) {\n totalNewFields[key] = object[key];\n } else if (isTerminal(object[key]) || isTerminal(put[key])) {\n totalNewFields[key] = put[key];\n } else {\n totalNewFields[key] = _setDeep(object[key], put[key]);\n }\n }\n\n // Apply any new keys that the base object didn't have.\n var newKeys = Object.keys(put);\n for (ii = 0; Line truncated
"OrderedMap":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule OrderedMap\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\nvar mixInto = require(\"./mixInto\");\n\nvar PREFIX = 'key:';\n\n/**\n * Utility to extract a backing object from an initialization `Array`, allowing\n * the caller to assist in resolving the unique ID for each entry via the\n * `keyExtractor` callback. The `keyExtractor` must extract non-empty strings or\n * numbers.\n * @param {Array<Object!>} arr Array of items.\n * @param {function} keyExtractor Extracts a unique key from each item.\n * @return {Object} Map from unique key to originating value that the key was\n * extracted from.\n * @throws Exception if the initialization array has duplicate extracted keys.\n */\nfunction extractObjectFromArray(arr, keyExtractor) {\n var normalizedObj = {};\n for (var i=0; i < arr.length; i++) {\n var item = arr[i];\n var key = keyExtractor(item);\n assertValidPublicKey(key);\n var normalizedKey = PREFIX + key;\n invariant(\n !(normalizedKey in normalizedObj),\n 'OrderedMap: IDs returned by the key extraction function must be unique.'\n );\n normalizedObj[normalizedKey] = item;\n }\n return normalizedObj;\n}\n\n/**\n * Utility class for mappings with ordering. This class is to be used in an\n * immutable manner. A `OrderedMap` is very much like the native JavaScript\n * object, where keys map to values via the `get()` function. Also, like the\n * native JavaScript object, there is an ordering associated with the mapping.\n * This class is helpful because it eliminates many of the pitfalls that come\n * with the native JavaScript ordered mappings. Specifically, there are\n * inconsistencies with numeric keys in some JavaScript implementations\n * (enumeration ordering). This class protects against those pitfalls and\n * provides functional utilities for dealing with these `OrderedMap`s.\n *\n * - TODO:\n * - orderedMergeExclusive: Merges mutually exclusive `OrderedMap`s.\n * - mapReverse().\n *\n * @class {OrderedMap}\n * @constructor {OrderedMap}\n * @param {Object} normalizedObj Object that is known to be a defensive copy of\n * caller supplied data. We require a defensive copy to guard against callers\n * mutating. It is also assumed that the keys of `normalizedObj` have been\n * normalized and do not contain any numeric-appearing strings.\n * @param {number} computedLength The precomputed length of `_normalizedObj`\n * keys.\n * @private\n */\nfunction OrderedMapImpl(normalizedObj, computedLength) {\n this._normalizedObj = normalizedObj;\n this._computedPositions = null;\n this.length = computedLength;\n}\n\n/**\n * Validates a \"public\" key - that is, one that the public facing API supplies.\n * The key is then normalized for internal storage. In order to be considered\n * valid, all keys must be non-empty, defined, non-null strings or numbers.\n *\n * @param {string?} key Validates that the key is suitable for use in a\n * `OrderedMap`.\n * @throws Error if key is not appropriate for use in `OrderedMap`.\n */\nfunction assertValidPublicKey(key) {\n invariant(\n key !== '' && (typeof key === 'string' || typeof key === 'number'),\n 'OrderedMap: Key must be non-empty, non-null string or number.'\n );\n}\n\n/**\n * Validates that arguments to range operations are within the correct limits.\n *\n * @param {number} start Start of range.\n * @param {number} length Length of range.\n * @param {number} actualLen Actual length of range that should not be\n * exceeded.\n * @return {void} description\n */\nfunction assertValidRangeIndices(start, length, actualLen) {\n invariant(\n typeof start === 'number' &&\n typeof length === 'number' &&\n length >= 0 &&\n start >= 0 &&\n start + length <= actualLen,\n 'OrderedMap: `mapRange` and `forEachRange` expect non-negative start and ' +\n 'length arguments within the bounds of the instance.'\n );\n}\n\n/**\n * Merges two \"normalized\" objects (objects who's key have been normalized) into\n * a `OrderedMap`.\n *\n * @param {Object} a Object of key value pairs.\n * @param {Object} b Object of key value pairs.\n * @return {OrderedMap} new `OrderedMap` that results in merging `a` and `b`.\n */\nfunction _fromNormalizedObjects(a, b) {\n // Second optional, both must be plain JavaScript objects.\n invariant(\n a && a.constructor === Object && (!b |Line truncated
"ReactChildren":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactChildren\n */\n\n\"use strict\";\n\nvar PooledClass = require(\"./PooledClass\");\n\nvar invariant = require(\"./invariant\");\nvar traverseAllChildren = require(\"./traverseAllChildren\");\n\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\nvar threeArgumentPooler = PooledClass.threeArgumentPooler;\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * traversal. Allows avoiding binding callbacks.\n *\n * @constructor ForEachBookKeeping\n * @param {!function} forEachFunction Function to perform traversal with.\n * @param {?*} forEachContext Context to perform context with.\n */\nfunction ForEachBookKeeping(forEachFunction, forEachContext) {\n this.forEachFunction = forEachFunction;\n this.forEachContext = forEachContext;\n}\nPooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);\n\nfunction forEachSingleChild(traverseContext, child, name, i) {\n var forEachBookKeeping = traverseContext;\n forEachBookKeeping.forEachFunction.call(\n forEachBookKeeping.forEachContext, child, i);\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {array} children\n * @param {function(*, int)} forEachFunc.\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n if (children == null) {\n return children;\n }\n\n var traverseContext =\n ForEachBookKeeping.getPooled(forEachFunc, forEachContext);\n traverseAllChildren(children, forEachSingleChild, traverseContext);\n ForEachBookKeeping.release(traverseContext);\n}\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * mapping. Allows avoiding binding callbacks.\n *\n * @constructor MapBookKeeping\n * @param {!*} mapResult Object containing the ordered map of results.\n * @param {!function} mapFunction Function to perform mapping with.\n * @param {?*} mapContext Context to perform mapping with.\n */\nfunction MapBookKeeping(mapResult, mapFunction, mapContext) {\n this.mapResult = mapResult;\n this.mapFunction = mapFunction;\n this.mapContext = mapContext;\n}\nPooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler);\n\nfunction mapSingleChildIntoContext(traverseContext, child, name, i) {\n var mapBookKeeping = traverseContext;\n var mapResult = mapBookKeeping.mapResult;\n var mappedChild =\n mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i);\n // We found a component instance\n invariant(\n !mapResult.hasOwnProperty(name),\n 'ReactChildren.map(...): Encountered two children with the same key, ' +\n '`%s`. Children keys must be unique.',\n name\n );\n mapResult[name] = mappedChild;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * TODO: This may likely break any calls to `ReactChildren.map` that were\n * previously relying on the fact that we guarded against null children.\n *\n * @param {array} children\n * @param {function(*, int)} mapFunction.\n * @param {*} mapContext Context for mapFunction.\n * @return {array} mirrored array with mapped children.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var mapResult = {};\n var traverseContext = MapBookKeeping.getPooled(mapResult, func, context);\n traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n MapBookKeeping.release(traverseContext);\n return mapResult;\n}\n\nvar ReactChildren = {\n forEach: forEachChildren,\n map: mapChildren\n};\n\nmodule.exports = ReactChildren;\n\nrequire(\"./mock-modules\").register(\"ReactChildren\", module);\n",
"Transaction":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule Transaction\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * `Transaction` creates a black box that is able to wrap any method such that\n * certain invariants are maintained before and after the method is invoked\n * (Even if an exception is thrown while invoking the wrapped method). Whoever\n * instantiates a transaction can provide enforcers of the invariants at\n * creation time. The `Transaction` class itself will supply one additional\n * automatic invariant for you - the invariant that any transaction instance\n * should not be ran while it is already being ran. You would typically create a\n * single instance of a `Transaction` for reuse multiple times, that potentially\n * is used to wrap several different methods. Wrappers are extremely simple -\n * they only require implementing two methods.\n *\n * <pre>\n * wrappers (injected at creation time)\n * + +\n * | |\n * +-----------------|--------|--------------+\n * | v | |\n * | +---------------+ | |\n * | +--| wrapper1 |---|----+ |\n * | | +---------------+ v | |\n * | | +-------------+ | |\n * | | +----| wrapper2 |--------+ |\n * | | | +-------------+ | | |\n * | | | | | |\n * | v v v v | wrapper\n * | +---+ +---+ +---------+ +---+ +---+ | invariants\n * perform(anyMethod) | | | | | | | | | | | | maintained\n * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->\n * | | | | | | | | | | | |\n * | | | | | | | | | | | |\n * | | | | | | | | | | | |\n * | +---+ +---+ +---------+ +---+ +---+ |\n * | initialize close |\n * +-----------------------------------------+\n * </pre>\n *\n * Bonus:\n * - Reports timing metrics by method name and wrapper index.\n *\n * Use cases:\n * - Preserving the input selection ranges before/after reconciliation.\n * Restoring selection even in the event of an unexpected error.\n * - Deactivating events while rearranging the DOM, preventing blurs/focuses,\n * while guaranteeing that afterwards, the event system is reactivated.\n * - Flushing a queue of collected DOM mutations to the main UI thread after a\n * reconciliation takes place in a worker thread.\n * - Invoking any collected `componentDidRender` callbacks after rendering new\n * content.\n * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue\n * to preserve the `scrollTop` (an automatic scroll aware DOM).\n * - (Future use case): Layout calculations before and after DOM upates.\n *\n * Transactional plugin API:\n * - A module that has an `initialize` method that returns any precomputation.\n * - and a `close` method that accepts the precomputation. `close` is invoked\n * when the wrapped process is completed, or has failed.\n *\n * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules\n * that implement `initialize` and `close`.\n * @return {Transaction} Single transaction for reuse in thread.\n *\n * @class Transaction\n */\nvar Mixin = {\n /**\n * Sets up this instance so that it is prepared for collecting metrics. Does\n * so such that this setup method may be used on an instance that is already\n * initialized, in a way that does not consume additional memory upon reuse.\n * That can be useful if you decide to make your subclass of this mixin a\n * \"PooledClass\".\n */\n reinitializeTransaction: function() {\n this.transactionWrappers = this.getTransactionWrappers();\n if (!this.wrapperInitData) {\n this.wrapperInitData = [];\n } else {\n this.wrapperInitData.length = 0;\n }\n if (!this.timingMetrics) {\n this.timingMetrics = {};\n }\n this.timLine truncated
"escapeTextForBrowser":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule escapeTextForBrowser\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ESCAPE_LOOKUP = {\n \"&\": \"&amp;\",\n \">\": \"&gt;\",\n \"<\": \"&lt;\",\n \"\\\"\": \"&quot;\",\n \"'\": \"&#x27;\",\n \"/\": \"&#x2f;\"\n};\n\nvar ESCAPE_REGEX = /[&><\"'\\/]/g;\n\nfunction escaper(match) {\n return ESCAPE_LOOKUP[match];\n}\n\n/**\n * Escapes text to prevent scripting attacks.\n *\n * @param {*} text Text value to escape.\n * @return {string} An escaped string.\n */\nfunction escapeTextForBrowser(text) {\n return ('' + text).replace(ESCAPE_REGEX, escaper);\n}\n\nmodule.exports = escapeTextForBrowser;\n\nrequire(\"./mock-modules\").register(\"escapeTextForBrowser\", module);\n",
"joinClasses":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule joinClasses\n * @typechecks static-only\n */\n\n\"use strict\";\n\n/**\n * Combines multiple className strings into one.\n * http://jsperf.com/joinclasses-args-vs-array\n *\n * @param {...?string} classes\n * @return {string}\n */\nfunction joinClasses(className/*, ... */) {\n if (!className) {\n className = '';\n }\n var nextClass;\n var argLength = arguments.length;\n if (argLength > 1) {\n for (var ii = 1; ii < argLength; ii++) {\n nextClass = arguments[ii];\n nextClass && (className += ' ' + nextClass);\n }\n }\n return className;\n}\n\nmodule.exports = joinClasses;\n\nrequire(\"./mock-modules\").register(\"joinClasses\", module);\n",
"keyMirror":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule keyMirror\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n * var COLORS = keyMirror({blue: null, red: null});\n * var myColor = COLORS.blue;\n * var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n * Input: {key1: val1, key2: val2}\n * Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nvar keyMirror = function(obj) {\n var ret = {};\n var key;\n invariant(\n obj instanceof Object && !Array.isArray(obj),\n 'keyMirror(...): Argument must be an object.'\n );\n for (key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n ret[key] = key;\n }\n return ret;\n};\n\nmodule.exports = keyMirror;\n\nrequire(\"./mock-modules\").register(\"keyMirror\", module);\n",
"memoizeStringOnly":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule memoizeStringOnly\n * @typechecks static-only\n */\n\n\"use strict\";\n\n/**\n * Memoizes the return value of a function that accepts one string argument.\n *\n * @param {function} callback\n * @return {function}\n */\nfunction memoizeStringOnly(callback) {\n var cache = {};\n return function(string) {\n if (cache.hasOwnProperty(string)) {\n return cache[string];\n } else {\n return cache[string] = callback.call(this, string);\n }\n };\n}\n\nmodule.exports = memoizeStringOnly;\n\nrequire(\"./mock-modules\").register(\"memoizeStringOnly\", module);\n",
"onlyChild":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule onlyChild\n */\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection. The current implementation of this\n * function assumes that a single child gets passed without a wrapper, but the\n * purpose of this helper function is to abstract away the particular structure\n * of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactComponent} The first and only `ReactComponent` contained in the\n * structure.\n */\nfunction onlyChild(children) {\n invariant(\n ReactComponent.isValidComponent(children),\n 'onlyChild must be passed a children with exactly one child.'\n );\n return children;\n}\n\nmodule.exports = onlyChild;\n\nrequire(\"./mock-modules\").register(\"onlyChild\", module);\n",
"mergeHelpers":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mergeHelpers\n *\n * requiresPolyfills: Array.isArray\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\nvar keyMirror = require(\"./keyMirror\");\n\n/**\n * Maximum number of levels to traverse. Will catch circular structures.\n * @const\n */\nvar MAX_MERGE_DEPTH = 36;\n\n/**\n * We won't worry about edge cases like new String('x') or new Boolean(true).\n * Functions are considered terminals, and arrays are not.\n * @param {*} o The item/object/value to test.\n * @return {boolean} true iff the argument is a terminal.\n */\nvar isTerminal = function(o) {\n return typeof o !== 'object' || o === null;\n};\n\nvar mergeHelpers = {\n\n MAX_MERGE_DEPTH: MAX_MERGE_DEPTH,\n\n isTerminal: isTerminal,\n\n /**\n * Converts null/undefined values into empty object.\n *\n * @param {?Object=} arg Argument to be normalized (nullable optional)\n * @return {!Object}\n */\n normalizeMergeArg: function(arg) {\n return arg === undefined || arg === null ? {} : arg;\n },\n\n /**\n * If merging Arrays, a merge strategy *must* be supplied. If not, it is\n * likely the caller's fault. If this function is ever called with anything\n * but `one` and `two` being `Array`s, it is the fault of the merge utilities.\n *\n * @param {*} one Array to merge into.\n * @param {*} two Array to merge from.\n */\n checkMergeArrayArgs: function(one, two) {\n invariant(\n Array.isArray(one) && Array.isArray(two),\n 'Critical assumptions about the merge functions have been violated. ' +\n 'This is the fault of the merge functions themselves, not necessarily ' +\n 'the callers.'\n );\n },\n\n /**\n * @param {*} one Object to merge into.\n * @param {*} two Object to merge from.\n */\n checkMergeObjectArgs: function(one, two) {\n mergeHelpers.checkMergeObjectArg(one);\n mergeHelpers.checkMergeObjectArg(two);\n },\n\n /**\n * @param {*} arg\n */\n checkMergeObjectArg: function(arg) {\n invariant(\n !isTerminal(arg) && !Array.isArray(arg),\n 'Critical assumptions about the merge functions have been violated. ' +\n 'This is the fault of the merge functions themselves, not necessarily ' +\n 'the callers.'\n );\n },\n\n /**\n * Checks that a merge was not given a circular object or an object that had\n * too great of depth.\n *\n * @param {number} Level of recursion to validate against maximum.\n */\n checkMergeLevel: function(level) {\n invariant(\n level < MAX_MERGE_DEPTH,\n 'Maximum deep merge depth exceeded. You may be attempting to merge ' +\n 'circular structures in an unsupported way.'\n );\n },\n\n /**\n * Checks that the supplied merge strategy is valid.\n *\n * @param {string} Array merge strategy.\n */\n checkArrayStrategy: function(strategy) {\n invariant(\n strategy === undefined || strategy in mergeHelpers.ArrayStrategies,\n 'You must provide an array strategy to deep merge functions to ' +\n 'instruct the deep merge how to resolve merging two arrays.'\n );\n },\n\n /**\n * Set of possible behaviors of merge algorithms when encountering two Arrays\n * that must be merged together.\n * - `clobber`: The left `Array` is ignored.\n * - `indexByIndex`: The result is achieved by recursively deep merging at\n * each index. (not yet supported.)\n */\n ArrayStrategies: keyMirror({\n Clobber: true,\n IndexByIndex: true\n })\n\n};\n\nmodule.exports = mergeHelpers;\n\nrequire(\"./mock-modules\").register(\"mergeHelpers\", module);\n",
"mergeInto":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mergeInto\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar mergeHelpers = require(\"./mergeHelpers\");\n\nvar checkMergeObjectArg = mergeHelpers.checkMergeObjectArg;\n\n/**\n * Shallow merges two structures by mutating the first parameter.\n *\n * @param {object} one Object to be merged into.\n * @param {?object} two Optional object with properties to merge from.\n */\nfunction mergeInto(one, two) {\n checkMergeObjectArg(one);\n if (two != null) {\n checkMergeObjectArg(two);\n for (var key in two) {\n if (!two.hasOwnProperty(key)) {\n continue;\n }\n one[key] = two[key];\n }\n }\n}\n\nmodule.exports = mergeInto;\n\nrequire(\"./mock-modules\").register(\"mergeInto\", module);\n",
"mergeDeep":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mergeDeep\n */\n\n\"use strict\";\n\nvar mergeHelpers = require(\"./mergeHelpers\");\nvar mergeDeepInto = require(\"./mergeDeepInto\");\n\nvar checkArrayStrategy = mergeHelpers.checkArrayStrategy;\nvar checkMergeObjectArgs = mergeHelpers.checkMergeObjectArgs;\nvar normalizeMergeArg = mergeHelpers.normalizeMergeArg;\n\n/**\n * @see mergeDeepImpl comments.\n *\n * @param {!Object} one returned will be an structural extension of this.\n * @param {!Object} two values from two take precedence over values in one.\n * @param {?Enum=} arrayStrategy One of `arrayStrategies`.\n * @return {!Object} the extension of one by two.\n */\nvar mergeDeep = function(oneParam, twoParam, arrayStrategy) {\n var one = normalizeMergeArg(oneParam);\n var two = normalizeMergeArg(twoParam);\n checkMergeObjectArgs(one, two);\n checkArrayStrategy(arrayStrategy);\n var newObj = {};\n // TODO: This is horribly inefficient. Even when some deep object in `one`\n // will be clobbered by another entity in `two`, we perform a clone of that\n // entire structure. To make this code more efficient, we'll need to either\n // enhance `mergeDeepInto` to accept multiple arguments or mirror that code\n // here.\n mergeDeepInto(newObj, one, arrayStrategy);\n mergeDeepInto(newObj, two, arrayStrategy);\n return newObj;\n};\n\n\nmodule.exports = mergeDeep;\n\nrequire(\"./mock-modules\").register(\"mergeDeep\", module);\n",
"mergeDeepInto":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule mergeDeepInto\n */\n\n// Empty blocks improve readability so disable that warning\n// jshint -W035\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\nvar mergeHelpers = require(\"./mergeHelpers\");\n\nvar ArrayStrategies = mergeHelpers.ArrayStrategies;\nvar checkArrayStrategy = mergeHelpers.checkArrayStrategy;\nvar checkMergeArrayArgs = mergeHelpers.checkMergeArrayArgs;\nvar checkMergeLevel = mergeHelpers.checkMergeLevel;\nvar checkMergeObjectArgs = mergeHelpers.checkMergeObjectArgs;\nvar isTerminal = mergeHelpers.isTerminal;\nvar normalizeMergeArg = mergeHelpers.normalizeMergeArg;\n\n/**\n * Every deep merge function must handle merging in each of the following cases\n * at every level. We may refer to letters below in implementations. For each\n * case listed, the \"Result\" listed describes the *value* of the result, but\n * does not specify anything about the memory graph of the result. In other\n * words the Results listed below will be the same for `merge` and `mergeInto`\n * but `merge` may have different guarantees about mutation/cloning. In the\n * table, \"Object\" refers to a non- Array, non-terminal object. One result is\n * undefined and requires that the caller specify the resolution policy (only\n * when trying to merge two arrays).\n *\n * Scenario Result\n * --------------------------------------------------------------\n * [A]: (terminal, terminal) right terminal\n * [B]: (terminal, Array) right Array\n * [C]: (terminal, Object) right Object\n * [D]: (terminal, not present) left terminal\n * [E]: (Array, terminal) right terminal\n * [F]: (Array, Array) UNDEFINED - MUST SPECIFY POLICY\n * [G]: (Array, Object) right Object\n * [H]: (Array, not present) left Array\n * [I]: (Object, terminal) right terminal\n * [J]: (Object, Array) right Array\n * [K]: (Object, Object) merge of left and right Objects\n * [L]: (Object, not present) left Object\n * [M]: (not present, terminal) right terminal\n * [N]: (not present, Array) right Array\n * [O]: (not present, Object) right Object\n *\n * All merge functions are only expected to reason about \"own\" properties and,\n * any prototypical properties should have no effect on the result. At the first\n * level of recursion in deep merges, we may choose to normalize arguments\n * (convert undefined to empty objects etc.) The above chart does not describe\n * the result of those top level operations which behave specially due to the\n * normalization.\n */\n\n/**\n * Deep merge implementation for non-Array, non-terminal Objects.\n *\n * @param {!Object} one non-Array, non-terminal Object to be mutated deeply.\n * @param {!Object} two non-Array, non-terminal taking precedence over `one`.\n * @param {?Enum=} arrayStrategy one of `arrayStrategies`.\n * @param {!number} level The level of recursion.\n */\nvar mergeDeepIntoObjects = function(one, two, arrayStrategy, level) {\n checkMergeObjectArgs(one, two);\n checkMergeLevel(level);\n var twoKeys = two ? Object.keys(two) : [];\n for (var i = 0; i < twoKeys.length; i++) {\n var twoKey = twoKeys[i];\n mergeSingleFieldDeep(one, two, twoKey, arrayStrategy, level);\n }\n};\n\n/**\n * Deep merge implementation for Arrays.\n *\n * @param {!Array} one Array to deep merge.\n * @param {!Array} two Array to deep merge \"into\" `one`.\n * @param {?Enum=} arrayStrategy one of `arrayStrategies`.\n * @param {!number} level Level of recursion.\n */\nvar mergeDeepIntoArrays = function(one, two, arrayStrategy, level) {\n checkMergeArrayArgs(one, two);\n checkMergeLevel(level);\n\n var maxLen = Math.max(one.length, two.length);\n for (var i = 0; i < maxLen; i++) {\n mergeSingleFieldDeep(one, two, i, arrayStrategy, level);\n }\n};\n\n/**\n * Given two truthy containers `one` and `two`, and a `key`, performs a deep\n * merge on a logical field.\n *\n * @param {!Array|Object} one Container to merge into.\n * @param {!Array|Object} two Container to merge from.\n * @param {!string} key Key of field that should be merged.\n * @param {lEnum=} arrayStrategy One of `arrayStrategies`.\n * @param {!number} level Current level of recursion.\n */\nvar mergeSingleFieldDeep = function(one, two, key, arrayStrategy, level) {\n var twoVal = two[key];\n var twoValIsPresent = two.hasOwnProperLine truncated
"sliceChildren":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule sliceChildren\n */\n\n\"use strict\";\n\nvar flattenChildren = require(\"./flattenChildren\");\n\n/**\n * Slice children that are typically specified as `props.children`. This version\n * of slice children ignores empty child components.\n *\n * @param {*} children The children set to filter.\n * @param {number} start The first zero-based index to include in the subset.\n * @param {?number} end The non-inclusive last index of the subset.\n * @return {object} mirrored array with mapped children\n */\nfunction sliceChildren(children, start, end) {\n if (children == null) {\n return children;\n }\n\n var slicedChildren = {};\n var flattenedMap = flattenChildren(children);\n var ii = 0;\n for (var key in flattenedMap) {\n if (!flattenedMap.hasOwnProperty(key)) {\n continue;\n }\n var child = flattenedMap[key];\n // In this version of slice children we ignore empty children.\n if (child !== null) {\n if (ii >= start) {\n slicedChildren[key] = child;\n }\n ii++;\n if (end != null && ii >= end) {\n break;\n }\n }\n }\n return slicedChildren;\n}\n\nmodule.exports = sliceChildren;\n\nrequire(\"./mock-modules\").register(\"sliceChildren\", module);\n",
"traverseAllChildren":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule traverseAllChildren\n */\n\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactTextComponent = require(\"./ReactTextComponent\");\n\nvar invariant = require(\"./invariant\");\n\n/**\n * TODO: Test that:\n * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`.\n * 2. it('should fail when supplied duplicate key', function() {\n * 3. That a single child and an array with one item have the same key pattern.\n * });\n */\n\n/**\n * @param {?*} children Children tree container.\n * @param {!string} nameSoFar Name of the key path so far.\n * @param {!number} indexSoFar Number of children encountered until this point.\n * @param {!function} callback Callback to invoke with each child found.\n * @param {?*} traverseContext Used to pass information throughout the traversal\n * process.\n * @return {!number} The number of children in this subtree.\n */\nvar traverseAllChildrenImpl =\n function(children, nameSoFar, indexSoFar, callback, traverseContext) {\n var subtreeCount = 0; // Count of children found in the current subtree.\n if (Array.isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var nextName = nameSoFar + ReactComponent.getKey(child, i);\n var nextIndex = indexSoFar + subtreeCount;\n subtreeCount += traverseAllChildrenImpl(\n child,\n nextName,\n nextIndex,\n callback,\n traverseContext\n );\n }\n } else {\n var type = typeof children;\n var isOnlyChild = nameSoFar === '';\n // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows\n var storageName = isOnlyChild ?\n ReactComponent.getKey(children, 0):\n nameSoFar;\n if (children === null || children === undefined || type === 'boolean') {\n // All of the above are perceived as null.\n callback(traverseContext, null, storageName, indexSoFar);\n subtreeCount = 1;\n } else if (children.mountComponentIntoNode) {\n callback(traverseContext, children, storageName, indexSoFar);\n subtreeCount = 1;\n } else {\n if (type === 'object') {\n invariant(\n !children || children.nodeType !== 1,\n 'traverseAllChildren(...): Encountered an invalid child; DOM ' +\n 'elements are not valid children of React components.'\n );\n for (var key in children) {\n if (children.hasOwnProperty(key)) {\n subtreeCount += traverseAllChildrenImpl(\n children[key],\n nameSoFar + '{' + key + '}',\n indexSoFar + subtreeCount,\n callback,\n traverseContext\n );\n }\n }\n } else if (type === 'string') {\n var normalizedText = new ReactTextComponent(children);\n callback(traverseContext, normalizedText, storageName, indexSoFar);\n subtreeCount += 1;\n } else if (type === 'number') {\n var normalizedNumber = new ReactTextComponent('' + children);\n callback(traverseContext, normalizedNumber, storageName, indexSoFar);\n subtreeCount += 1;\n }\n }\n }\n return subtreeCount;\n };\n\n/**\n * Traverses children that are typically specified as `props.children`, but\n * might also be specified through attributes:\n *\n * - `traverseAllChildren(this.props.children, ...)`\n * - `traverseAllChildren(this.props.leftPanelChildren, ...)`\n *\n * The `traverseContext` is an optional argument that is passed through the\n * entire traversal. It can be used to store accumulations or anything else that\n * the callback might find relevant.\n *\n * @param {?*} children Children tree object.\n * @param {!function} callback To invoke upon traversing each child.\n * @param {?*} traverseContext Context for traversal.\n */\nfunction traverseAllChildren(children, callback, traverseContext) {\n if (children !== null && children !== undefined) {\n traverseAllChildrenImpl(children, '', 0, callback, traverseContext);\n }\n}\n\nmodule.exports = traverseAllChildren;\n\nrequire(\"./mock-modules\").register(\"traverseAllChildren\", module);\nLine truncated
"ex":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ex\n * @typechecks\n * @nostacktrace\n */\n\n/**\n * This function transforms error message with arguments into plain text error\n * message, so that it can be passed to window.onerror without losing anything.\n * It can then be transformed back by `erx()` function.\n *\n * Usage:\n * throw new Error(ex('Error %s from %s', errorCode, userID));\n *\n * @param {string} errorMessage\n */\n\nvar ex = function(errorMessage/*, arg1, arg2, ...*/) {\n var args = Array.prototype.slice.call(arguments).map(function(arg) {\n return String(arg);\n });\n var expectedLength = errorMessage.split('%s').length - 1;\n\n if (expectedLength !== args.length - 1) {\n // something wrong with the formatting string\n return ex('ex args number mismatch: %s', JSON.stringify(args));\n }\n\n return ex._prefix + JSON.stringify(args) + ex._suffix;\n};\n\nex._prefix = '<![EX[';\nex._suffix = ']]>';\n\nmodule.exports = ex;\n\nrequire(\"./mock-modules\").register(\"ex\", module);\n",
"erx":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule erx\n * @typechecks\n * @nostacktrace\n */\n\nvar ex = require(\"./ex\");\n\n/**\n * This function reverse transform done by `ex()`.\n *\n * This function only transforms plain text message back to error message with\n * arguments. If the error message is minified by the server, it has to be\n * looked up on the server.\n *\n * This function is designed to be idempotent, so erx(erx(whatever)) will be\n * the same as erx(whatever).\n *\n * @param {string|array<string>} transformedMessage\n */\n\nvar erx = function(transformedMessage) {\n if (typeof transformedMessage !== 'string') {\n // possibly double `erx`ed and return original value\n return transformedMessage;\n }\n\n var prefixLeft = transformedMessage.indexOf(ex._prefix);\n var suffixLeft = transformedMessage.lastIndexOf(ex._suffix);\n if (prefixLeft < 0 || suffixLeft < 0) {\n // plain error message without any transformation\n return [transformedMessage];\n }\n\n var prefixRight = prefixLeft + ex._prefix.length;\n var suffixRight = suffixLeft + ex._suffix.length;\n if (prefixRight >= suffixLeft) {\n return ['erx slice failure: %s', transformedMessage];\n }\n\n var leftSlice = transformedMessage.substring(0, prefixLeft);\n var rightSlice = transformedMessage.substring(suffixRight);\n transformedMessage = transformedMessage.substring(prefixRight, suffixLeft);\n\n var messageWithParams;\n try {\n messageWithParams = JSON.parse(transformedMessage);\n messageWithParams[0] =\n leftSlice + messageWithParams[0] + rightSlice;\n } catch(err) {\n return ['erx parse failure: %s', transformedMessage];\n }\n\n return messageWithParams;\n};\n\nmodule.exports = erx;\n\nrequire(\"./mock-modules\").register(\"erx\", module);\n",
"ReactTextComponent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactTextComponent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactComponent = require(\"./ReactComponent\");\nvar ReactMount = require(\"./ReactMount\");\n\nvar escapeTextForBrowser = require(\"./escapeTextForBrowser\");\nvar mixInto = require(\"./mixInto\");\n\n/**\n * Text nodes violate a couple assumptions that React makes about components:\n *\n * - When mounting text into the DOM, adjacent text nodes are merged.\n * - Text nodes cannot be assigned a React root ID.\n *\n * This component is used to wrap strings in elements so that they can undergo\n * the same reconciliation that is applied to elements.\n *\n * TODO: Investigate representing React components in the DOM with text nodes.\n *\n * @class ReactTextComponent\n * @extends ReactComponent\n * @internal\n */\nvar ReactTextComponent = function(initialText) {\n this.construct({text: initialText});\n};\n\nmixInto(ReactTextComponent, ReactComponent.Mixin);\nmixInto(ReactTextComponent, {\n\n /**\n * Creates the markup for this text node. This node is not intended to have\n * any features besides containing text content.\n *\n * @param {string} rootID DOM ID of the root node.\n * @param {ReactReconcileTransaction} transaction\n * @param {number} mountDepth number of components in the owner hierarchy\n * @return {string} Markup for this text node.\n * @internal\n */\n mountComponent: function(rootID, transaction, mountDepth) {\n ReactComponent.Mixin.mountComponent.call(\n this,\n rootID,\n transaction,\n mountDepth\n );\n return (\n '<span ' + ReactMount.ATTR_NAME + '=\"' + rootID + '\">' +\n escapeTextForBrowser(this.props.text) +\n '</span>'\n );\n },\n\n /**\n * Updates this component by updating the text content.\n *\n * @param {object} nextProps Contains the next text content.\n * @param {ReactReconcileTransaction} transaction\n * @internal\n */\n receiveProps: function(nextProps, transaction) {\n if (nextProps.text !== this.props.text) {\n this.props.text = nextProps.text;\n ReactComponent.DOMIDOperations.updateTextContentByID(\n this._rootNodeID,\n nextProps.text\n );\n }\n }\n\n});\n\nmodule.exports = ReactTextComponent;\n\nrequire(\"./mock-modules\").register(\"ReactTextComponent\", module);\n",
"invariant":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule invariant\n */\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf style format and arguments to provide information about\n * what broke and what you were expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nfunction invariant(condition) {\n if (!condition) {\n throw new Error('Invariant Violation');\n }\n}\n\nmodule.exports = invariant;\n\nif (true) {\n var invariantDev = function(condition, format, a, b, c, d, e, f) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n\n if (!condition) {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n throw new Error(\n 'Invariant Violation: ' +\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n }\n };\n\n module.exports = invariantDev;\n}\n\nrequire(\"./mock-modules\").register(\"invariant\", module);\n",
"CSSCore":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule CSSCore\n * @typechecks\n */\n\nvar invariant = require(\"./invariant\");\n\n/**\n * The CSSCore module specifies the API (and implements most of the methods)\n * that should be used when dealing with the display of elements (via their\n * CSS classes and visibility on screeni. It is an API focused on mutating the\n * display and not reading it as no logical state should be encoded in the\n * display of elements.\n */\n\n/**\n * Tests whether the element has the class specified.\n *\n * Note: This function is not exported in CSSCore because CSS classNames should\n * not store any logical information about the element. Use DataStore to store\n * information on an element.\n *\n * @param {DOMElement} element the element to set the class on\n * @param {string} className the CSS className\n * @returns {boolean} true if the element has the class, false if not\n */\nfunction hasClass(element, className) {\n if (element.classList) {\n return !!className && element.classList.contains(className);\n }\n return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;\n}\n\nvar CSSCore = {\n\n /**\n * Adds the class passed in to the element if it doesn't already have it.\n *\n * @param {DOMElement} element the element to set the class on\n * @param {string} className the CSS className\n * @return {DOMElement} the element passed in\n */\n addClass: function(element, className) {\n invariant(\n !/\\s/.test(className),\n 'CSSCore.addClass takes only a single class name. \"%s\" contains ' +\n 'multiple classes.', className\n );\n\n if (className) {\n if (element.classList) {\n element.classList.add(className);\n } else if (!hasClass(element, className)) {\n element.className = element.className + ' ' + className;\n }\n }\n return element;\n },\n\n /**\n * Removes the class passed in from the element\n *\n * @param {DOMElement} element the element to set the class on\n * @param {string} className the CSS className\n * @return {DOMElement} the element passed in\n */\n removeClass: function(element, className) {\n invariant(\n !/\\s/.test(className),\n 'CSSCore.removeClass takes only a single class name. \"%s\" contains ' +\n 'multiple classes.', className\n );\n\n if (className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (hasClass(element, className)) {\n element.className = element.className\n .replace(new RegExp('(^|\\\\s)' + className + '(?:\\\\s|$)', 'g'), '$1')\n .replace(/\\s+/g, ' ') // multiple spaces to one\n .replace(/^\\s*|\\s*$/g, ''); // trim the ends\n }\n }\n return element;\n },\n\n /**\n * Helper to add or remove a class from an element based on a condition.\n *\n * @param {DOMElement} element the element to set the class on\n * @param {string} className the CSS className\n * @param {*} bool condition to whether to add or remove the class\n * @return {DOMElement} the element passed in\n */\n conditionClass: function(element, className, bool) {\n return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);\n }\n};\n\nmodule.exports = CSSCore;\n\nrequire(\"./mock-modules\").register(\"CSSCore\", module);\n",
"ReactPerf":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactPerf\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactPerf = {\n /**\n * Boolean to enable/disable measurement. Set to false by default to prevent\n * accidental logging and perf loss.\n */\n enableMeasure: false,\n\n /**\n * Holds onto the measure function in use. By default, don't measure\n * anything, but we'll override this if we inject a measure function.\n */\n storedMeasure: _noMeasure,\n\n /**\n * Use this to wrap methods you want to measure.\n *\n * @param {string} objName\n * @param {string} fnName\n * @param {function} func\n * @return {function}\n */\n measure: function(objName, fnName, func) {\n if (true) {\n var measuredFunc = null;\n return function() {\n if (ReactPerf.enableMeasure) {\n if (!measuredFunc) {\n measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);\n }\n return measuredFunc.apply(this, arguments);\n }\n return func.apply(this, arguments);\n };\n }\n return func;\n },\n\n injection: {\n /**\n * @param {function} measure\n */\n injectMeasure: function(measure) {\n ReactPerf.storedMeasure = measure;\n }\n }\n};\n\nif (true) {\n var ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n var URL = ExecutionEnvironment.canUseDOM ? window.location.href : '';\n ReactPerf.enableMeasure = ReactPerf.enableMeasure ||\n !!URL.match(/[?&]react_perf\\b/);\n}\n\n/**\n * Simply passes through the measured function, without measuring it.\n *\n * @param {string} objName\n * @param {string} fnName\n * @param {function} func\n * @return {function}\n */\nfunction _noMeasure(objName, fnName, func) {\n return func;\n}\n\nmodule.exports = ReactPerf;\n\nrequire(\"./mock-modules\").register(\"ReactPerf\", module);\n",
"ReactTransitionEvents":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactTransitionEvents\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar EVENT_NAME_MAP = {\n transitionend: {\n 'transition': 'transitionend',\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'mozTransitionEnd',\n 'OTransition': 'oTransitionEnd',\n 'msTransition': 'MSTransitionEnd'\n },\n\n animationend: {\n 'animation': 'animationend',\n 'WebkitAnimation': 'webkitAnimationEnd',\n 'MozAnimation': 'mozAnimationEnd',\n 'OAnimation': 'oAnimationEnd',\n 'msAnimation': 'MSAnimationEnd'\n }\n};\n\nvar endEvents = [];\n\nfunction detectEvents() {\n var testEl = document.createElement('div');\n var style = testEl.style;\n for (var baseEventName in EVENT_NAME_MAP) {\n var baseEvents = EVENT_NAME_MAP[baseEventName];\n for (var styleName in baseEvents) {\n if (styleName in style) {\n endEvents.push(baseEvents[styleName]);\n break;\n }\n }\n }\n}\n\nif (ExecutionEnvironment.canUseDOM) {\n detectEvents();\n}\n\n// We use the raw {add|remove}EventListener() call because EventListener\n// does not know how to remove event listeners and we really should\n// clean up. Also, these events are not triggered in older browsers\n// so we should be A-OK here.\n\nfunction addEventListener(node, eventName, eventListener) {\n node.addEventListener(eventName, eventListener, false);\n}\n\nfunction removeEventListener(node, eventName, eventListener) {\n node.removeEventListener(eventName, eventListener, false);\n}\n\nvar ReactTransitionEvents = {\n addEndEventListener: function(node, eventListener) {\n if (endEvents.length === 0) {\n // If CSS transitions are not supported, trigger an \"end animation\"\n // event immediately.\n window.setTimeout(eventListener, 0);\n return;\n }\n endEvents.forEach(function(endEvent) {\n addEventListener(node, endEvent, eventListener);\n });\n },\n\n removeEndEventListener: function(node, eventListener) {\n if (endEvents.length === 0) {\n return;\n }\n endEvents.forEach(function(endEvent) {\n removeEventListener(node, endEvent, eventListener);\n });\n }\n};\n\nmodule.exports = ReactTransitionEvents;\n\nrequire(\"./mock-modules\").register(\"ReactTransitionEvents\", module);\n",
"ReactOwner":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactOwner\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * ReactOwners are capable of storing references to owned components.\n *\n * All components are capable of //being// referenced by owner components, but\n * only ReactOwner components are capable of //referencing// owned components.\n * The named reference is known as a \"ref\".\n *\n * Refs are available when mounted and updated during reconciliation.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return (\n * <div onClick={this.handleClick}>\n * <CustomComponent ref=\"custom\" />\n * </div>\n * );\n * },\n * handleClick: function() {\n * this.refs.custom.handleClick();\n * },\n * componentDidMount: function() {\n * this.refs.custom.initialize();\n * }\n * });\n *\n * Refs should rarely be used. When refs are used, they should only be done to\n * control data that is not handled by React's data flow.\n *\n * @class ReactOwner\n */\nvar ReactOwner = {\n\n /**\n * @param {?object} object\n * @return {boolean} True if `object` is a valid owner.\n * @final\n */\n isValidOwner: function(object) {\n return !!(\n object &&\n typeof object.attachRef === 'function' &&\n typeof object.detachRef === 'function'\n );\n },\n\n /**\n * Adds a component by ref to an owner component.\n *\n * @param {ReactComponent} component Component to reference.\n * @param {string} ref Name by which to refer to the component.\n * @param {ReactOwner} owner Component on which to record the ref.\n * @final\n * @internal\n */\n addComponentAsRefTo: function(component, ref, owner) {\n invariant(\n ReactOwner.isValidOwner(owner),\n 'addComponentAsRefTo(...): Only a ReactOwner can have refs.'\n );\n owner.attachRef(ref, component);\n },\n\n /**\n * Removes a component by ref from an owner component.\n *\n * @param {ReactComponent} component Component to dereference.\n * @param {string} ref Name of the ref to remove.\n * @param {ReactOwner} owner Component on which the ref is recorded.\n * @final\n * @internal\n */\n removeComponentAsRefFrom: function(component, ref, owner) {\n invariant(\n ReactOwner.isValidOwner(owner),\n 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs.'\n );\n // Check that `component` is still the current ref because we do not want to\n // detach the ref if another component stole it.\n if (owner.refs[ref] === component) {\n owner.detachRef(ref);\n }\n },\n\n /**\n * A ReactComponent must mix this in to have refs.\n *\n * @lends {ReactOwner.prototype}\n */\n Mixin: {\n\n /**\n * Lazily allocates the refs object and stores `component` as `ref`.\n *\n * @param {string} ref Reference name.\n * @param {component} component Component to store as `ref`.\n * @final\n * @private\n */\n attachRef: function(ref, component) {\n invariant(\n component.isOwnedBy(this),\n 'attachRef(%s, ...): Only a component\\'s owner can store a ref to it.',\n ref\n );\n var refs = this.refs || (this.refs = {});\n refs[ref] = component;\n },\n\n /**\n * Detaches a reference name.\n *\n * @param {string} ref Name to dereference.\n * @final\n * @private\n */\n detachRef: function(ref) {\n delete this.refs[ref];\n }\n\n }\n\n};\n\nmodule.exports = ReactOwner;\n\nrequire(\"./mock-modules\").register(\"ReactOwner\", module);\n",
"ReactComponentEnvironment":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactComponentEnvironment\n */\n\nvar ReactComponentBrowserEnvironment =\n require(\"./ReactComponentBrowserEnvironment\");\n\nvar ReactComponentEnvironment = ReactComponentBrowserEnvironment;\n\nmodule.exports = ReactComponentEnvironment;\n\nrequire(\"./mock-modules\").register(\"ReactComponentEnvironment\", module);\n",
"ReactPropTransferer":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactPropTransferer\n */\n\n\"use strict\";\n\nvar emptyFunction = require(\"./emptyFunction\");\nvar invariant = require(\"./invariant\");\nvar joinClasses = require(\"./joinClasses\");\nvar merge = require(\"./merge\");\n\n/**\n * Creates a transfer strategy that will merge prop values using the supplied\n * `mergeStrategy`. If a prop was previously unset, this just sets it.\n *\n * @param {function} mergeStrategy\n * @return {function}\n */\nfunction createTransferStrategy(mergeStrategy) {\n return function(props, key, value) {\n if (!props.hasOwnProperty(key)) {\n props[key] = value;\n } else {\n props[key] = mergeStrategy(props[key], value);\n }\n };\n}\n\n/**\n * Transfer strategies dictate how props are transferred by `transferPropsTo`.\n */\nvar TransferStrategies = {\n /**\n * Never transfer `children`.\n */\n children: emptyFunction,\n /**\n * Transfer the `className` prop by merging them.\n */\n className: createTransferStrategy(joinClasses),\n /**\n * Never transfer the `ref` prop.\n */\n ref: emptyFunction,\n /**\n * Transfer the `style` prop (which is an object) by merging them.\n */\n style: createTransferStrategy(merge)\n};\n\n/**\n * ReactPropTransferer are capable of transferring props to another component\n * using a `transferPropsTo` method.\n *\n * @class ReactPropTransferer\n */\nvar ReactPropTransferer = {\n\n TransferStrategies: TransferStrategies,\n\n /**\n * @lends {ReactPropTransferer.prototype}\n */\n Mixin: {\n\n /**\n * Transfer props from this component to a target component.\n *\n * Props that do not have an explicit transfer strategy will be transferred\n * only if the target component does not already have the prop set.\n *\n * This is usually used to pass down props to a returned root component.\n *\n * @param {ReactComponent} component Component receiving the properties.\n * @return {ReactComponent} The supplied `component`.\n * @final\n * @protected\n */\n transferPropsTo: function(component) {\n invariant(\n component.props.__owner__ === this,\n '%s: You can\\'t call transferPropsTo() on a component that you ' +\n 'don\\'t own, %s. This usually means you are calling ' +\n 'transferPropsTo() on a component passed in as props or children.',\n this.constructor.displayName,\n component.constructor.displayName\n );\n\n var props = {};\n for (var thatKey in component.props) {\n if (component.props.hasOwnProperty(thatKey)) {\n props[thatKey] = component.props[thatKey];\n }\n }\n for (var thisKey in this.props) {\n if (!this.props.hasOwnProperty(thisKey)) {\n continue;\n }\n var transferStrategy = TransferStrategies[thisKey];\n if (transferStrategy) {\n transferStrategy(props, thisKey, this.props[thisKey]);\n } else if (!props.hasOwnProperty(thisKey)) {\n props[thisKey] = this.props[thisKey];\n }\n }\n component.props = props;\n return component;\n }\n\n }\n\n};\n\nmodule.exports = ReactPropTransferer;\n\nrequire(\"./mock-modules\").register(\"ReactPropTransferer\", module);\n",
"objMap":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule objMap\n */\n\n\"use strict\";\n\n/**\n * For each key/value pair, invokes callback func and constructs a resulting\n * object which contains, for every key in obj, values that are the result of\n * of invoking the function:\n *\n * func(value, key, iteration)\n *\n * @param {?object} obj Object to map keys over\n * @param {function} func Invoked for each key/val pair.\n * @param {?*} context\n * @return {?object} Result of mapping or null if obj is falsey\n */\nfunction objMap(obj, func, context) {\n if (!obj) {\n return null;\n }\n var i = 0;\n var ret = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n ret[key] = func.call(context, obj[key], key, i++);\n }\n }\n return ret;\n}\n\nmodule.exports = objMap;\n\nrequire(\"./mock-modules\").register(\"objMap\", module);\n",
"createObjectFrom":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule createObjectFrom\n */\n\n/**\n * Construct an object from an array of keys\n * and optionally specified value or list of values.\n *\n * >>> createObjectFrom(['a','b','c']);\n * {a: true, b: true, c: true}\n *\n * >>> createObjectFrom(['a','b','c'], false);\n * {a: false, b: false, c: false}\n *\n * >>> createObjectFrom(['a','b','c'], 'monkey');\n * {c:'monkey', b:'monkey' c:'monkey'}\n *\n * >>> createObjectFrom(['a','b','c'], [1,2,3]);\n * {a: 1, b: 2, c: 3}\n *\n * >>> createObjectFrom(['women', 'men'], [true, false]);\n * {women: true, men: false}\n *\n * @param Array list of keys\n * @param mixed optional value or value array. defaults true.\n * @returns object\n */\nfunction createObjectFrom(keys, values /* = true */) {\n if (true) {\n if (!Array.isArray(keys)) {\n throw new TypeError('Must pass an array of keys.');\n }\n }\n\n var object = {};\n var isArray = Array.isArray(values);\n if (typeof values == 'undefined') {\n values = true;\n }\n\n for (var ii = keys.length; ii--;) {\n object[keys[ii]] = isArray ? values[ii] : values;\n }\n return object;\n}\n\nmodule.exports = createObjectFrom;\n\nrequire(\"./mock-modules\").register(\"createObjectFrom\", module);\n",
"$":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule $\n * @typechecks\n */\n\nvar ge = require(\"./ge\");\nvar ex = require(\"./ex\");\n\n/**\n * Find a node by ID.\n *\n * If your application code depends on the existence of the element, use $,\n * which will throw if the element doesn't exist.\n *\n * If you're not sure whether or not the element exists, use ge instead, and\n * manually check for the element's existence in your application code.\n *\n * @param {string|DOMDocument|DOMElement|DOMTextNode|Comment} id\n * @return {DOMDocument|DOMElement|DOMTextNode|Comment}\n */\nfunction $(id) {\n var element = ge(id);\n if (!element) {\n throw new Error(ex(\n 'Tried to get element with id of \"%s\" but it is not present on the page.',\n id\n ));\n }\n return element;\n}\n\nmodule.exports = $;\n\nrequire(\"./mock-modules\").register(\"$\", module);\n",
"getReactRootElementInContainer":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getReactRootElementInContainer\n */\n\n\"use strict\";\n\n/**\n * @param {DOMElement} container DOM element that may contain a React component\n * @return {?*} DOM element that may have the reactRoot ID, or null.\n */\nfunction getReactRootElementInContainer(container) {\n return container && container.firstChild;\n}\n\nmodule.exports = getReactRootElementInContainer;\n\nrequire(\"./mock-modules\").register(\"getReactRootElementInContainer\", module);\n",
"nodeContains":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule nodeContains\n * @typechecks\n */\n\nvar isTextNode = require(\"./isTextNode\");\n\n/*jslint bitwise:true */\n\n/**\n * Checks if a given DOM node contains or is another DOM node.\n *\n * @param {?DOMNode} outerNode Outer DOM node.\n * @param {?DOMNode} innerNode Inner DOM node.\n * @return {boolean} True if `outerNode` contains or is `innerNode`.\n */\nfunction nodeContains(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return nodeContains(outerNode, innerNode.parentNode);\n } else if (outerNode.contains) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nmodule.exports = nodeContains;\n\nrequire(\"./mock-modules\").register(\"nodeContains\", module);\n",
"PooledClass":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule PooledClass\n */\n\n\"use strict\";\n\n/**\n * Static poolers. Several custom versions for each potential number of\n * arguments. A completely generic pooler is easy to implement, but would\n * require accessing the `arguments` object. In each of these, `this` refers to\n * the Class itself, not an instance. If any others are needed, simply add them\n * here, or in their own files.\n */\nvar oneArgumentPooler = function(copyFieldsFrom) {\n var Klass = this;\n if (Klass.instancePool.length) {\n var instance = Klass.instancePool.pop();\n Klass.call(instance, copyFieldsFrom);\n return instance;\n } else {\n return new Klass(copyFieldsFrom);\n }\n};\n\nvar twoArgumentPooler = function(a1, a2) {\n var Klass = this;\n if (Klass.instancePool.length) {\n var instance = Klass.instancePool.pop();\n Klass.call(instance, a1, a2);\n return instance;\n } else {\n return new Klass(a1, a2);\n }\n};\n\nvar threeArgumentPooler = function(a1, a2, a3) {\n var Klass = this;\n if (Klass.instancePool.length) {\n var instance = Klass.instancePool.pop();\n Klass.call(instance, a1, a2, a3);\n return instance;\n } else {\n return new Klass(a1, a2, a3);\n }\n};\n\nvar fiveArgumentPooler = function(a1, a2, a3, a4, a5) {\n var Klass = this;\n if (Klass.instancePool.length) {\n var instance = Klass.instancePool.pop();\n Klass.call(instance, a1, a2, a3, a4, a5);\n return instance;\n } else {\n return new Klass(a1, a2, a3, a4, a5);\n }\n};\n\nvar standardReleaser = function(instance) {\n var Klass = this;\n if (instance.destructor) {\n instance.destructor();\n }\n if (Klass.instancePool.length < Klass.poolSize) {\n Klass.instancePool.push(instance);\n }\n};\n\nvar DEFAULT_POOL_SIZE = 10;\nvar DEFAULT_POOLER = oneArgumentPooler;\n\n/**\n * Augments `CopyConstructor` to be a poolable class, augmenting only the class\n * itself (statically) not adding any prototypical fields. Any CopyConstructor\n * you give this may have a `poolSize` property, and will look for a\n * prototypical `destructor` on instances (optional).\n *\n * @param {Function} CopyConstructor Constructor that can be used to reset.\n * @param {Function} pooler Customizable pooler.\n */\nvar addPoolingTo = function(CopyConstructor, pooler) {\n var NewKlass = CopyConstructor;\n NewKlass.instancePool = [];\n NewKlass.getPooled = pooler || DEFAULT_POOLER;\n if (!NewKlass.poolSize) {\n NewKlass.poolSize = DEFAULT_POOL_SIZE;\n }\n NewKlass.release = standardReleaser;\n return NewKlass;\n};\n\nvar PooledClass = {\n addPoolingTo: addPoolingTo,\n oneArgumentPooler: oneArgumentPooler,\n twoArgumentPooler: twoArgumentPooler,\n threeArgumentPooler: threeArgumentPooler,\n fiveArgumentPooler: fiveArgumentPooler\n};\n\nmodule.exports = PooledClass;\n\nrequire(\"./mock-modules\").register(\"PooledClass\", module);\n",
"ReactInputSelection":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactInputSelection\n */\n\n\"use strict\";\n\nvar ReactDOMSelection = require(\"./ReactDOMSelection\");\n\nvar getActiveElement = require(\"./getActiveElement\");\nvar nodeContains = require(\"./nodeContains\");\n\nfunction isInDocument(node) {\n return nodeContains(document.documentElement, node);\n}\n\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\nvar ReactInputSelection = {\n\n hasSelectionCapabilities: function(elem) {\n return elem && (\n (elem.nodeName === 'INPUT' && elem.type === 'text') ||\n elem.nodeName === 'TEXTAREA' ||\n elem.contentEditable === 'true'\n );\n },\n\n getSelectionInformation: function() {\n var focusedElem = getActiveElement();\n return {\n focusedElem: focusedElem,\n selectionRange:\n ReactInputSelection.hasSelectionCapabilities(focusedElem) ?\n ReactInputSelection.getSelection(focusedElem) :\n null\n };\n },\n\n /**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\n restoreSelection: function(priorSelectionInformation) {\n var curFocusedElem = getActiveElement();\n var priorFocusedElem = priorSelectionInformation.focusedElem;\n var priorSelectionRange = priorSelectionInformation.selectionRange;\n if (curFocusedElem !== priorFocusedElem &&\n isInDocument(priorFocusedElem)) {\n if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {\n ReactInputSelection.setSelection(\n priorFocusedElem,\n priorSelectionRange\n );\n }\n priorFocusedElem.focus();\n }\n },\n\n /**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\n getSelection: function(input) {\n var selection;\n\n if ('selectionStart' in input) {\n // Modern browser with input or textarea.\n selection = {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else if (document.selection && input.nodeName === 'INPUT') {\n // IE8 input.\n var range = document.selection.createRange();\n // There can only be one selection per document in IE, so it must\n // be in our element.\n if (range.parentElement() === input) {\n selection = {\n start: -range.moveStart('character', -input.value.length),\n end: -range.moveEnd('character', -input.value.length)\n };\n }\n } else {\n // Content editable or old IE textarea.\n selection = ReactDOMSelection.getOffsets(input);\n }\n\n return selection || {start: 0, end: 0};\n },\n\n /**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input Set selection bounds of this input or textarea\n * -@offsets Object of same form that is returned from get*\n */\n setSelection: function(input, offsets) {\n var start = offsets.start;\n var end = offsets.end;\n if (typeof end === 'undefined') {\n end = start;\n }\n\n if ('selectionStart' in input) {\n input.selectionStart = start;\n input.selectionEnd = Math.min(end, input.value.length);\n } else if (document.selection && input.nodeName === 'INPUT') {\n var range = input.createTextRange();\n range.collapse(true);\n range.moveStart('character', start);\n range.moveEnd('character', end - start);\n range.select();\n } else {\n ReactDOMSelection.setOffsets(input, offsets);\n }\n }\n};\n\nmodule.exports = ReactInputSelection;\n\nrequire(\"./mock-modules\").register(\"ReactInputSelection\", module);\n",
"ReactMountReady":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactMountReady\n */\n\n\"use strict\";\n\nvar PooledClass = require(\"./PooledClass\");\n\nvar mixInto = require(\"./mixInto\");\n\n/**\n * A specialized pseudo-event module to help keep track of components waiting to\n * be notified when their DOM representations are available for use.\n *\n * This implements `PooledClass`, so you should never need to instantiate this.\n * Instead, use `ReactMountReady.getPooled()`.\n *\n * @param {?array<function>} initialCollection\n * @class ReactMountReady\n * @implements PooledClass\n * @internal\n */\nfunction ReactMountReady(initialCollection) {\n this._queue = initialCollection || null;\n}\n\nmixInto(ReactMountReady, {\n\n /**\n * Enqueues a callback to be invoked when `notifyAll` is invoked. This is used\n * to enqueue calls to `componentDidMount` and `componentDidUpdate`.\n *\n * @param {ReactComponent} component Component being rendered.\n * @param {function(DOMElement)} callback Invoked when `notifyAll` is invoked.\n * @internal\n */\n enqueue: function(component, callback) {\n this._queue = this._queue || [];\n this._queue.push({component: component, callback: callback});\n },\n\n /**\n * Invokes all enqueued callbacks and clears the queue. This is invoked after\n * the DOM representation of a component has been created or updated.\n *\n * @internal\n */\n notifyAll: function() {\n var queue = this._queue;\n if (queue) {\n this._queue = null;\n for (var i = 0, l = queue.length; i < l; i++) {\n var component = queue[i].component;\n var callback = queue[i].callback;\n callback.call(component, component.getDOMNode());\n }\n queue.length = 0;\n }\n },\n\n /**\n * Resets the internal queue.\n *\n * @internal\n */\n reset: function() {\n this._queue = null;\n },\n\n /**\n * `PooledClass` looks for this.\n */\n destructor: function() {\n this.reset();\n }\n\n});\n\nPooledClass.addPoolingTo(ReactMountReady);\n\nmodule.exports = ReactMountReady;\n\nrequire(\"./mock-modules\").register(\"ReactMountReady\", module);\n",
"ReactDOMForm":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMForm\n */\n\n\"use strict\";\n\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar EventConstants = require(\"./EventConstants\");\n\n// Store a reference to the <form> `ReactDOMComponent`.\nvar form = ReactDOM.form;\n\n/**\n * Since onSubmit doesn't bubble OR capture on the top level in IE8, we need\n * to capture it on the <form> element itself. There are lots of hacks we could\n * do to accomplish this, but the most reliable is to make <form> a\n * composite component and use `componentDidMount` to attach the event handlers.\n */\nvar ReactDOMForm = ReactCompositeComponent.createClass({\n render: function() {\n // TODO: Instead of using `ReactDOM` directly, we should use JSX. However,\n // `jshint` fails to parse JSX so in order for linting to work in the open\n // source repo, we need to just use `ReactDOM.form`.\n return this.transferPropsTo(form(null, this.props.children));\n },\n\n componentDidMount: function(node) {\n ReactEventEmitter.trapBubbledEvent(\n EventConstants.topLevelTypes.topSubmit,\n 'submit',\n node\n );\n }\n});\n\nmodule.exports = ReactDOMForm;\n\nrequire(\"./mock-modules\").register(\"ReactDOMForm\", module);\n",
"ReactDOMButton":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMButton\n */\n\n\"use strict\";\n\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\n\nvar keyMirror = require(\"./keyMirror\");\n\n// Store a reference to the <button> `ReactDOMComponent`.\nvar button = ReactDOM.button;\n\nvar mouseListenerNames = keyMirror({\n onClick: true,\n onDoubleClick: true,\n onMouseDown: true,\n onMouseMove: true,\n onMouseUp: true,\n onClickCapture: true,\n onDoubleClickCapture: true,\n onMouseDownCapture: true,\n onMouseMoveCapture: true,\n onMouseUpCapture: true\n});\n\n/**\n * Implements a <button> native component that does not receive mouse events\n * when `disabled` is set.\n */\nvar ReactDOMButton = ReactCompositeComponent.createClass({\n\n render: function() {\n var props = {};\n\n // Copy the props; except the mouse listeners if we're disabled\n for (var key in this.props) {\n if (this.props.hasOwnProperty(key) &&\n (!this.props.disabled || !mouseListenerNames[key])) {\n props[key] = this.props[key];\n }\n }\n\n return button(props, this.props.children);\n }\n\n});\n\nmodule.exports = ReactDOMButton;\n\nrequire(\"./mock-modules\").register(\"ReactDOMButton\", module);\n",
"ReactDOMInput":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMInput\n */\n\n\"use strict\";\n\nvar DOMPropertyOperations = require(\"./DOMPropertyOperations\");\nvar LinkedValueMixin = require(\"./LinkedValueMixin\");\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\nvar ReactMount = require(\"./ReactMount\");\n\nvar invariant = require(\"./invariant\");\nvar merge = require(\"./merge\");\n\n// Store a reference to the <input> `ReactDOMComponent`.\nvar input = ReactDOM.input;\n\nvar instancesByReactID = {};\n\n/**\n * Implements an <input> native component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\nvar ReactDOMInput = ReactCompositeComponent.createClass({\n mixins: [LinkedValueMixin],\n\n getInitialState: function() {\n var defaultValue = this.props.defaultValue;\n return {\n checked: this.props.defaultChecked || false,\n value: defaultValue != null ? defaultValue : ''\n };\n },\n\n shouldComponentUpdate: function() {\n // Defer any updates to this component during the `onChange` handler.\n return !this._isChanging;\n },\n\n render: function() {\n // Clone `this.props` so we don't mutate the input.\n var props = merge(this.props);\n\n props.defaultChecked = null;\n props.defaultValue = null;\n props.checked =\n this.props.checked != null ? this.props.checked : this.state.checked;\n\n var value = this.getValue();\n props.value = value != null ? value : this.state.value;\n\n props.onChange = this._handleChange;\n\n return input(props, this.props.children);\n },\n\n componentDidMount: function(rootNode) {\n var id = ReactMount.getID(rootNode);\n instancesByReactID[id] = this;\n },\n\n componentWillUnmount: function() {\n var rootNode = this.getDOMNode();\n var id = ReactMount.getID(rootNode);\n delete instancesByReactID[id];\n },\n\n componentDidUpdate: function(prevProps, prevState, rootNode) {\n if (this.props.checked != null) {\n DOMPropertyOperations.setValueForProperty(\n rootNode,\n 'checked',\n this.props.checked || false\n );\n }\n\n var value = this.getValue();\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);\n }\n },\n\n _handleChange: function(event) {\n var returnValue;\n var onChange = this.getOnChange();\n if (onChange) {\n this._isChanging = true;\n returnValue = onChange(event);\n this._isChanging = false;\n }\n this.setState({\n checked: event.target.checked,\n value: event.target.value\n });\n\n var name = this.props.name;\n if (this.props.type === 'radio' && name != null) {\n var rootNode = this.getDOMNode();\n // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form, let's just use the global\n // `getElementsByName` to ensure we don't miss anything.\n var group = document.getElementsByName(name);\n for (var i = 0, groupLen = group.length; i < groupLen; i++) {\n var otherNode = group[i];\n if (otherNode === rootNode ||\n otherNode.nodeName !== 'INPUT' || otherNode.type !== 'radio' ||\n otherNode.form !== rootNode.form) {\n continue;\n }\n var otherID = ReactMount.g Line truncated
"ReactDOMOption":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMOption\n */\n\n\"use strict\";\n\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\n\n// Store a reference to the <option> `ReactDOMComponent`.\nvar option = ReactDOM.option;\n\n/**\n * Implements an <option> native component that warns when `selected` is set.\n */\nvar ReactDOMOption = ReactCompositeComponent.createClass({\n\n componentWillMount: function() {\n // TODO (yungsters): Remove support for `selected` in <option>.\n if (this.props.selected != null) {\n if (true) {\n console.warn(\n 'Use the `defaultValue` or `value` props on <select> instead of ' +\n 'setting `selected` on <option>.'\n );\n }\n }\n },\n\n render: function() {\n return option(this.props, this.props.children);\n }\n\n});\n\nmodule.exports = ReactDOMOption;\n\nrequire(\"./mock-modules\").register(\"ReactDOMOption\", module);\n",
"ReactDOMSelect":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMSelect\n */\n\n\"use strict\";\n\nvar LinkedValueMixin = require(\"./LinkedValueMixin\");\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\n\nvar invariant = require(\"./invariant\");\nvar merge = require(\"./merge\");\n\n// Store a reference to the <select> `ReactDOMComponent`.\nvar select = ReactDOM.select;\n\n/**\n * Validation function for `value` and `defaultValue`.\n * @private\n */\nfunction selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n invariant(\n Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be an array if `multiple` is ' +\n 'true.',\n propName\n );\n } else {\n invariant(\n !Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be a scalar value if ' +\n '`multiple` is false.',\n propName\n );\n }\n}\n\n/**\n * If `value` is supplied, updates <option> elements on mount and update.\n * @private\n */\nfunction updateOptions() {\n /*jshint validthis:true */\n var propValue = this.getValue();\n var value = propValue != null ? propValue : this.state.value;\n var options = this.getDOMNode().options;\n var selectedValue = '' + value;\n\n for (var i = 0, l = options.length; i < l; i++) {\n var selected = this.props.multiple ?\n selectedValue.indexOf(options[i].value) >= 0 :\n selected = options[i].value === selectedValue;\n\n if (selected !== options[i].selected) {\n options[i].selected = selected;\n }\n }\n}\n\n/**\n * Implements a <select> native component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * string. If `multiple` is true, the prop must be an array of strings.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\nvar ReactDOMSelect = ReactCompositeComponent.createClass({\n mixins: [LinkedValueMixin],\n\n propTypes: {\n defaultValue: selectValueType,\n value: selectValueType\n },\n\n getInitialState: function() {\n return {value: this.props.defaultValue || (this.props.multiple ? [] : '')};\n },\n\n componentWillReceiveProps: function(nextProps) {\n if (!this.props.multiple && nextProps.multiple) {\n this.setState({value: [this.state.value]});\n } else if (this.props.multiple && !nextProps.multiple) {\n this.setState({value: this.state.value[0]});\n }\n },\n\n shouldComponentUpdate: function() {\n // Defer any updates to this component during the `onChange` handler.\n return !this._isChanging;\n },\n\n render: function() {\n // Clone `this.props` so we don't mutate the input.\n var props = merge(this.props);\n\n props.onChange = this._handleChange;\n props.value = null;\n\n return select(props, this.props.children);\n },\n\n componentDidMount: updateOptions,\n\n componentDidUpdate: updateOptions,\n\n _handleChange: function(event) {\n var returnValue;\n var onChange = this.getOnChange();\n if (onChange) {\n this._isChanging = true;\n returnValue = onChange(event);\n this._isChanging = false;\n }\n\n var selectedValue;\n if (this.props.multiple) {\n selectedValue = [];\n var options = event.target.options;\n for (var i = 0, l = options.length; i < l; i++) {\n if (options[i].selected) {\n selectedValue.push(options[i].value);\n }\n }\n } else {\n selectedValue = event.target.value;\n }\n\n this.setState({value: selectedValue});\n return returnValue;\n }\n\n});\n\nmodule.exports = ReactDOMSelect;\n\nrequire(\"./mock-modules\").register(\"ReactDOMSelect\", module);\n",
"ReactDOMTextarea":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMTextarea\n */\n\n\"use strict\";\n\nvar DOMPropertyOperations = require(\"./DOMPropertyOperations\");\nvar LinkedValueMixin = require(\"./LinkedValueMixin\");\nvar ReactCompositeComponent = require(\"./ReactCompositeComponent\");\nvar ReactDOM = require(\"./ReactDOM\");\n\nvar invariant = require(\"./invariant\");\nvar merge = require(\"./merge\");\n\n// Store a reference to the <textarea> `ReactDOMComponent`.\nvar textarea = ReactDOM.textarea;\n\n/**\n * Implements a <textarea> native component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\nvar ReactDOMTextarea = ReactCompositeComponent.createClass({\n mixins: [LinkedValueMixin],\n\n getInitialState: function() {\n var defaultValue = this.props.defaultValue;\n // TODO (yungsters): Remove support for children content in <textarea>.\n var children = this.props.children;\n if (children != null) {\n if (true) {\n console.warn(\n 'Use the `defaultValue` or `value` props instead of setting ' +\n 'children on <textarea>.'\n );\n }\n invariant(\n defaultValue == null,\n 'If you supply `defaultValue` on a <textarea>, do not pass children.'\n );\n if (Array.isArray(children)) {\n invariant(\n children.length <= 1,\n '<textarea> can only have at most one child.'\n );\n children = children[0];\n }\n\n defaultValue = '' + children;\n }\n if (defaultValue == null) {\n defaultValue = '';\n }\n var value = this.getValue();\n return {\n // We save the initial value so that `ReactDOMComponent` doesn't update\n // `textContent` (unnecessary since we update value).\n // The initial value can be a boolean or object so that's why it's\n // forced to be a string.\n initialValue: '' + (value != null ? value : defaultValue),\n value: defaultValue\n };\n },\n\n shouldComponentUpdate: function() {\n // Defer any updates to this component during the `onChange` handler.\n return !this._isChanging;\n },\n\n render: function() {\n // Clone `this.props` so we don't mutate the input.\n var props = merge(this.props);\n var value = this.getValue();\n\n invariant(\n props.dangerouslySetInnerHTML == null,\n '`dangerouslySetInnerHTML` does not make sense on <textarea>.'\n );\n\n props.defaultValue = null;\n props.value = value != null ? value : this.state.value;\n props.onChange = this._handleChange;\n\n // Always set children to the same thing. In IE9, the selection range will\n // get reset if `textContent` is mutated.\n return textarea(props, this.state.initialValue);\n },\n\n componentDidUpdate: function(prevProps, prevState, rootNode) {\n var value = this.getValue();\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);\n }\n },\n\n _handleChange: function(event) {\n var returnValue;\n var onChange = this.getOnChange();\n if (onChange) {\n this._isChanging = true;\n returnValue = onChange(event);\n this._isChanging = false;\n }\n this.setState({value: event.target.value});\n return returnValue;\n }\n\n});\n\nmodule.exports = ReactDOMTextarea;\n\nrequire(\"./mock-modules\").register(\"ReactDOMTextarea\", module);\n",
"ReactEventTopLevelCallback":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactEventTopLevelCallback\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ReactEventEmitter = require(\"./ReactEventEmitter\");\nvar ReactMount = require(\"./ReactMount\");\n\nvar getEventTarget = require(\"./getEventTarget\");\n\n/**\n * @type {boolean}\n * @private\n */\nvar _topLevelListenersEnabled = true;\n\n/**\n * Top-level callback creator used to implement event handling using delegation.\n * This is used via dependency injection.\n */\nvar ReactEventTopLevelCallback = {\n\n /**\n * Sets whether or not any created callbacks should be enabled.\n *\n * @param {boolean} enabled True if callbacks should be enabled.\n */\n setEnabled: function(enabled) {\n _topLevelListenersEnabled = !!enabled;\n },\n\n /**\n * @return {boolean} True if callbacks are enabled.\n */\n isEnabled: function() {\n return _topLevelListenersEnabled;\n },\n\n /**\n * Creates a callback for the supplied `topLevelType` that could be added as\n * a listener to the document. The callback computes a `topLevelTarget` which\n * should be the root node of a mounted React component where the listener\n * is attached.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @return {function} Callback for handling top-level events.\n */\n createTopLevelCallback: function(topLevelType) {\n return function(nativeEvent) {\n if (!_topLevelListenersEnabled) {\n return;\n }\n // TODO: Remove when synthetic events are ready, this is for IE<9.\n if (nativeEvent.srcElement &&\n nativeEvent.srcElement !== nativeEvent.target) {\n nativeEvent.target = nativeEvent.srcElement;\n }\n var topLevelTarget = ReactMount.getFirstReactDOM(\n getEventTarget(nativeEvent)\n ) || window;\n var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';\n ReactEventEmitter.handleTopLevel(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n );\n };\n }\n\n};\n\nmodule.exports = ReactEventTopLevelCallback;\n\nrequire(\"./mock-modules\").register(\"ReactEventTopLevelCallback\", module);\n",
"DefaultDOMPropertyConfig":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule DefaultDOMPropertyConfig\n */\n\n/*jslint bitwise: true*/\n\n\"use strict\";\n\nvar DOMProperty = require(\"./DOMProperty\");\n\nvar MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;\nvar MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;\nvar HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;\nvar HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;\n\nvar DefaultDOMPropertyConfig = {\n isCustomAttribute: RegExp.prototype.test.bind(\n /^(data|aria)-[a-z_][a-z\\d_.\\-]*$/\n ),\n Properties: {\n /**\n * Standard Properties\n */\n accept: null,\n accessKey: null,\n action: null,\n allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,\n allowTransparency: MUST_USE_ATTRIBUTE,\n alt: null,\n autoComplete: null,\n autoFocus: HAS_BOOLEAN_VALUE,\n autoPlay: HAS_BOOLEAN_VALUE,\n cellPadding: null,\n cellSpacing: null,\n charSet: MUST_USE_ATTRIBUTE,\n checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n className: MUST_USE_PROPERTY,\n colSpan: null,\n content: null,\n contentEditable: null,\n contextMenu: MUST_USE_ATTRIBUTE,\n controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n data: null, // For `<object />` acts as `src`.\n dateTime: MUST_USE_ATTRIBUTE,\n dir: null,\n disabled: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n draggable: null,\n encType: null,\n form: MUST_USE_ATTRIBUTE,\n frameBorder: MUST_USE_ATTRIBUTE,\n height: MUST_USE_ATTRIBUTE,\n hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,\n href: null,\n htmlFor: null,\n httpEquiv: null,\n icon: null,\n id: MUST_USE_PROPERTY,\n label: null,\n lang: null,\n list: null,\n max: null,\n maxLength: MUST_USE_ATTRIBUTE,\n method: null,\n min: null,\n multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n name: null,\n pattern: null,\n placeholder: null,\n poster: null,\n preload: null,\n radioGroup: null,\n readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n rel: null,\n required: HAS_BOOLEAN_VALUE,\n role: MUST_USE_ATTRIBUTE,\n rowSpan: null,\n scrollLeft: MUST_USE_PROPERTY,\n scrollTop: MUST_USE_PROPERTY,\n selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n size: null,\n spellCheck: null,\n src: null,\n step: null,\n style: null,\n tabIndex: null,\n target: null,\n title: null,\n type: null,\n value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,\n width: MUST_USE_ATTRIBUTE,\n wmode: MUST_USE_ATTRIBUTE,\n\n /**\n * Non-standard Properties\n */\n autoCapitalize: null, // Supported in Mobile Safari for keyboard hints\n\n /**\n * SVG Properties\n */\n cx: MUST_USE_ATTRIBUTE,\n cy: MUST_USE_ATTRIBUTE,\n d: MUST_USE_ATTRIBUTE,\n fill: MUST_USE_ATTRIBUTE,\n fx: MUST_USE_ATTRIBUTE,\n fy: MUST_USE_ATTRIBUTE,\n gradientTransform: MUST_USE_ATTRIBUTE,\n gradientUnits: MUST_USE_ATTRIBUTE,\n offset: MUST_USE_ATTRIBUTE,\n points: MUST_USE_ATTRIBUTE,\n r: MUST_USE_ATTRIBUTE,\n rx: MUST_USE_ATTRIBUTE,\n ry: MUST_USE_ATTRIBUTE,\n spreadMethod: MUST_USE_ATTRIBUTE,\n stopColor: MUST_USE_ATTRIBUTE,\n stopOpacity: MUST_USE_ATTRIBUTE,\n stroke: MUST_USE_ATTRIBUTE,\n strokeLinecap: MUST_USE_ATTRIBUTE,\n strokeWidth: MUST_USE_ATTRIBUTE,\n transform: MUST_USE_ATTRIBUTE,\n version: MUST_USE_ATTRIBUTE,\n viewBox: MUST_USE_ATTRIBUTE,\n x1: MUST_USE_ATTRIBUTE,\n x2: MUST_USE_ATTRIBUTE,\n x: MUST_USE_ATTRIBUTE,\n y1: MUST_USE_ATTRIBUTE,\n y2: MUST_USE_ATTRIBUTE,\n y: MUST_USE_ATTRIBUTE\n },\n DOMAttributeNames: {\n className: 'class',\n gradientTransform: 'gradientTransform',\n gradientUnits: 'gradientUnits',\n htmlFor: 'for',\n spreadMethod: 'spreadMethod',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strokeLinecap: 'stroke-linecap',\n strokeWidth: 'stroke-width',\n viewBox: 'viewBox'\n },\n DOMPropertyNames: {\n autoCapitalize: 'autocapitalize',\n autoComplete: 'autocomplete',\n autoFocus: 'autofocus',\n autoPlay: 'autoplay',\n encType: 'enctype',\n radioGroup: 'radiogroup',\n spellCheck: 'spellcheck'\n },\n DOMMutationMethods: {\n /**\n * Setting `className` to null may cause it to be set to the string \"null\".\n *\Line truncated
"CompositionEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule CompositionEventPlugin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\nvar ReactInputSelection = require(\"./ReactInputSelection\");\nvar SyntheticCompositionEvent = require(\"./SyntheticCompositionEvent\");\n\nvar getTextContentAccessor = require(\"./getTextContentAccessor\");\nvar keyOf = require(\"./keyOf\");\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\n\nvar useCompositionEvent = ExecutionEnvironment.canUseDOM &&\n 'CompositionEvent' in window;\nvar topLevelTypes = EventConstants.topLevelTypes;\nvar currentComposition = null;\n\n// Events and their corresponding property names.\nvar eventTypes = {\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionEnd: null}),\n captured: keyOf({onCompositionEndCapture: null})\n }\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionStart: null}),\n captured: keyOf({onCompositionStartCapture: null})\n }\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionUpdate: null}),\n captured: keyOf({onCompositionUpdateCapture: null})\n }\n }\n};\n\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\nfunction getCompositionEventType(topLevelType) {\n switch (topLevelType) {\n case topLevelTypes.topCompositionStart:\n return eventTypes.compositionStart;\n case topLevelTypes.topCompositionEnd:\n return eventTypes.compositionEnd;\n case topLevelTypes.topCompositionUpdate:\n return eventTypes.compositionUpdate;\n }\n}\n\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackStart(topLevelType, nativeEvent) {\n return (\n topLevelType === topLevelTypes.topKeyDown &&\n nativeEvent.keyCode === START_KEYCODE\n );\n}\n\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackEnd(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case topLevelTypes.topKeyUp:\n // Command keys insert or clear IME input.\n return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);\n case topLevelTypes.topKeyDown:\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return (nativeEvent.keyCode !== START_KEYCODE);\n case topLevelTypes.topKeyPress:\n case topLevelTypes.topMouseDown:\n case topLevelTypes.topBlur:\n // Events are not possible without cancelling IME.\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Helper class stores information about selection and document state\n * so we can figure out what changed at a later date.\n *\n * @param {DOMEventTarget} root\n */\nfunction FallbackCompositionState(root) {\n this.root = root;\n this.startSelection = ReactInputSelection.getSelection(root);\n this.startValue = this.getText();\n}\n\n/**\n * Get current text of input.\n *\n * @return {string}\n */\nFallbackCompositionState.prototype.getText = function() {\n return this.root.value || this.root[getTextContentAccessor()];\n};\n\n/**\n * Text that has changed since the start of composition.\n *\n * @return {string}\n */\nFallbackCompositionState.prototype.getData = function() {\n var endValue = this.getText();\n var prefixLength = this.startSelection.start;\n var suffixLength = this.startValue.length - this.startSelection.end;\n\n return endValue.substr(\n prefixLength,\n endValue.length - suffixLength - prefixLength\n );\n};\n\n/**\n * This plugin creates `onCompositionStart`, `onCompositionUpdate` and\n * `onCompositionEnd` events on inputs, textareas and contentEditable\n * nodes.\n */\nvar CompositionEventPlugin = {\n\n eventTypes: eventTypes,\n\n /**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget Line truncated
"MobileSafariClickEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule MobileSafariClickEventPlugin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\n\nvar emptyFunction = require(\"./emptyFunction\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\n/**\n * Mobile Safari does not fire properly bubble click events on non-interactive\n * elements, which means delegated click listeners do not fire. The workaround\n * for this bug involves attaching an empty click listener on the target node.\n *\n * This particular plugin works around the bug by attaching an empty click\n * listener on `touchstart` (which does fire on every element).\n */\nvar MobileSafariClickEventPlugin = {\n\n eventTypes: null,\n\n /**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {*} An accumulation of synthetic events.\n * @see {EventPluginHub.extractEvents}\n */\n extractEvents: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent) {\n if (topLevelType === topLevelTypes.topTouchStart) {\n var target = nativeEvent.target;\n if (target && !target.onclick) {\n target.onclick = emptyFunction;\n }\n }\n }\n\n};\n\nmodule.exports = MobileSafariClickEventPlugin;\n\nrequire(\"./mock-modules\").register(\"MobileSafariClickEventPlugin\", module);\n",
"SelectEventPlugin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SelectEventPlugin\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\nvar EventPluginHub = require(\"./EventPluginHub\");\nvar EventPropagators = require(\"./EventPropagators\");\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\nvar ReactInputSelection = require(\"./ReactInputSelection\");\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\nvar getActiveElement = require(\"./getActiveElement\");\nvar isEventSupported = require(\"./isEventSupported\");\nvar isTextInputElement = require(\"./isTextInputElement\");\nvar keyOf = require(\"./keyOf\");\nvar shallowEqual = require(\"./shallowEqual\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nvar eventTypes = {\n select: {\n phasedRegistrationNames: {\n bubbled: keyOf({onSelect: null}),\n captured: keyOf({onSelectCapture: null})\n }\n }\n};\n\nvar useSelectionChange = false;\nvar useSelect = false;\n\nif (ExecutionEnvironment.canUseDOM) {\n useSelectionChange = 'onselectionchange' in document;\n useSelect = isEventSupported('select');\n}\n\nvar activeElement = null;\nvar activeElementID = null;\nvar activeNativeEvent = null;\nvar lastSelection = null;\nvar mouseDown = false;\n\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\n * @param {DOMElement} node\n * @param {object}\n */\nfunction getSelection(node) {\n if ('selectionStart' in node &&\n ReactInputSelection.hasSelectionCapabilities(node)) {\n return {\n start: node.selectionStart,\n end: node.selectionEnd\n };\n } else if (document.selection) {\n var range = document.selection.createRange();\n return {\n parentElement: range.parentElement(),\n text: range.text,\n top: range.boundingTop,\n left: range.boundingLeft\n };\n } else {\n var selection = window.getSelection();\n return {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset\n };\n }\n}\n\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @return {?SyntheticEvent}\n */\nfunction constructSelectEvent(nativeEvent) {\n // Ensure we have the right element, and that the user is not dragging a\n // selection (this matches native `select` event behavior).\n if (mouseDown || activeElement != getActiveElement()) {\n return;\n }\n\n // Only fire when selection has actually changed.\n var currentSelection = getSelection(activeElement);\n if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n lastSelection = currentSelection;\n\n var syntheticEvent = SyntheticEvent.getPooled(\n eventTypes.select,\n activeElementID,\n nativeEvent\n );\n\n syntheticEvent.type = 'select';\n syntheticEvent.target = activeElement;\n\n EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);\n\n return syntheticEvent;\n }\n}\n\n/**\n * Handle deferred event. And manually dispatch synthetic events.\n */\nfunction dispatchDeferredSelectEvent() {\n if (!activeNativeEvent) {\n return;\n }\n\n var syntheticEvent = constructSelectEvent(activeNativeEvent);\n activeNativeEvent = null;\n\n // Enqueue and process the abstract event manually.\n if (syntheticEvent) {\n EventPluginHub.enqueueEvents(syntheticEvent);\n EventPluginHub.processEventQueue();\n }\n}\n\n/**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\nvar SelectEventPlugin = {\n\n eventTypes: eventTypes,\n\n /**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native brows Line truncated
"ReactDefaultBatchingStrategy":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDefaultBatchingStrategy\n */\n\n\"use strict\";\n\nvar ReactUpdates = require(\"./ReactUpdates\");\nvar Transaction = require(\"./Transaction\");\n\nvar emptyFunction = require(\"./emptyFunction\");\nvar mixInto = require(\"./mixInto\");\n\nvar RESET_BATCHED_UPDATES = {\n initialize: emptyFunction,\n close: function() {\n ReactDefaultBatchingStrategy.isBatchingUpdates = false;\n }\n};\n\nvar FLUSH_BATCHED_UPDATES = {\n initialize: emptyFunction,\n close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)\n};\n\nvar TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];\n\nfunction ReactDefaultBatchingStrategyTransaction() {\n this.reinitializeTransaction();\n}\n\nmixInto(ReactDefaultBatchingStrategyTransaction, Transaction.Mixin);\nmixInto(ReactDefaultBatchingStrategyTransaction, {\n getTransactionWrappers: function() {\n return TRANSACTION_WRAPPERS;\n }\n});\n\nvar transaction = new ReactDefaultBatchingStrategyTransaction();\n\nvar ReactDefaultBatchingStrategy = {\n isBatchingUpdates: false,\n\n /**\n * Call the provided function in a context within which calls to `setState`\n * and friends are batched such that components aren't updated unnecessarily.\n */\n batchedUpdates: function(callback, param) {\n var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;\n\n ReactDefaultBatchingStrategy.isBatchingUpdates = true;\n\n // The code is written this way to avoid extra allocations\n if (alreadyBatchingUpdates) {\n callback(param);\n } else {\n transaction.perform(callback, null, param);\n }\n }\n};\n\nmodule.exports = ReactDefaultBatchingStrategy;\n\nrequire(\"./mock-modules\").register(\"ReactDefaultBatchingStrategy\", module);\n",
"ReactDefaultPerf":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDefaultPerf\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar performanceNow = require(\"./performanceNow\");\n\nvar ReactDefaultPerf = {};\n\nif (true) {\n ReactDefaultPerf = {\n /**\n * Gets the stored information for a given object's function.\n *\n * @param {string} objName\n * @param {string} fnName\n * @return {?object}\n */\n getInfo: function(objName, fnName) {\n if (!this.info[objName] || !this.info[objName][fnName]) {\n return null;\n }\n return this.info[objName][fnName];\n },\n\n /**\n * Gets the logs pertaining to a given object's function.\n *\n * @param {string} objName\n * @param {string} fnName\n * @return {?array<object>}\n */\n getLogs: function(objName, fnName) {\n if (!this.getInfo(objName, fnName)) {\n return null;\n }\n return this.logs.filter(function(log) {\n return log.objName === objName && log.fnName === fnName;\n });\n },\n\n /**\n * Runs through the logs and builds an array of arrays, where each array\n * walks through the mounting/updating of each component underneath.\n *\n * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'\n * @return {array<array>}\n */\n getRawRenderHistory: function(rootID) {\n var history = [];\n /**\n * Since logs are added after the method returns, the logs are in a sense\n * upside-down: the inner-most elements from mounting/updating are logged\n * first, and the last addition to the log is the top renderComponent.\n * Therefore, we flip the logs upside down for ease of processing, and\n * reverse the history array at the end so the earliest event has index 0.\n */\n var logs = this.logs.filter(function(log) {\n return log.reactID.indexOf(rootID) === 0;\n }).reverse();\n\n var subHistory = [];\n logs.forEach(function(log, i) {\n if (i && log.reactID === rootID && logs[i - 1].reactID !== rootID) {\n subHistory.length && history.push(subHistory);\n subHistory = [];\n }\n subHistory.push(log);\n });\n if (subHistory.length) {\n history.push(subHistory);\n }\n return history.reverse();\n },\n\n /**\n * Runs through the logs and builds an array of strings, where each string\n * is a multiline formatted way of walking through the mounting/updating\n * underneath.\n *\n * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'\n * @return {array<string>}\n */\n getRenderHistory: function(rootID) {\n var history = this.getRawRenderHistory(rootID);\n\n return history.map(function(subHistory) {\n var headerString = (\n 'log# Component (execution time) [bloat from logging]\\n' +\n '================================================================\\n'\n );\n return headerString + subHistory.map(function(log) {\n // Add two spaces for every layer in the reactID.\n var indents = '\\t' + Array(log.reactID.split('.[').length).join(' ');\n var delta = _microTime(log.timing.delta);\n var bloat = _microTime(log.timing.timeToLog);\n\n return log.index + indents + log.name + ' (' + delta + 'ms)' +\n ' [' + bloat + 'ms]';\n }).join('\\n');\n });\n },\n\n /**\n * Print the render history from `getRenderHistory` using console.log.\n * This is currently the best way to display perf data from\n * any React component; working on that.\n *\n * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'\n * @param {number} index\n */\n printRenderHistory: function(rootID, index) {\n var history = this.getRenderHistory(rootID);\n if (!history[index]) {\n console.warn(\n 'Index', index, 'isn\\'t available! ' +\n 'The render history is', history.length, 'long.'\n );\n return;\n }\n console.log(\n 'Loading render history #' + (index + 1) +\n ' of ' + history.length + ':\\n' + history[index]\n );\n },\n\n /**\n * Prints the heatmap legend to console, showing how the colors correspond\n * with render times. This relies on c Line truncated
"ReactMultiChildUpdateTypes":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactMultiChildUpdateTypes\n */\n\nvar keyMirror = require(\"./keyMirror\");\n\n/**\n * When a component's children are updated, a series of update configuration\n * objects are created in order to batch and serialize the required changes.\n *\n * Enumerates all the possible types of update configurations.\n *\n * @internal\n */\nvar ReactMultiChildUpdateTypes = keyMirror({\n INSERT_MARKUP: null,\n MOVE_EXISTING: null,\n REMOVE_NODE: null,\n TEXT_CONTENT: null\n});\n\nmodule.exports = ReactMultiChildUpdateTypes;\n\nrequire(\"./mock-modules\").register(\"ReactMultiChildUpdateTypes\", module);\n",
"flattenChildren":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule flattenChildren\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\nvar traverseAllChildren = require(\"./traverseAllChildren\");\n\n/**\n * @param {function} traverseContext Context passed through traversal.\n * @param {?ReactComponent} child React child component.\n * @param {!string} name String name of key path to child.\n */\nfunction flattenSingleChildIntoContext(traverseContext, child, name) {\n // We found a component instance.\n var result = traverseContext;\n invariant(\n !result.hasOwnProperty(name),\n 'flattenChildren(...): Encountered two children with the same key, `%s`. ' +\n 'Children keys must be unique.',\n name\n );\n result[name] = child;\n}\n\n/**\n * Flattens children that are typically specified as `props.children`.\n * @return {!object} flattened children keyed by name.\n */\nfunction flattenChildren(children) {\n if (children == null) {\n return children;\n }\n var result = {};\n traverseAllChildren(children, flattenSingleChildIntoContext, result);\n return result;\n}\n\nmodule.exports = flattenChildren;\n\nrequire(\"./mock-modules\").register(\"flattenChildren\", module);\n",
"EventListener":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventListener\n */\n\n/**\n * Upstream version of event listener. Does not take into account specific\n * nature of platform.\n */\nvar EventListener = {\n /**\n * Listens to bubbled events on a DOM node.\n *\n * @param {Element} el DOM element to register listener on.\n * @param {string} handlerBaseName 'click'/'mouseover'\n * @param {Function!} cb Callback function\n */\n listen: function(el, handlerBaseName, cb) {\n if (el.addEventListener) {\n el.addEventListener(handlerBaseName, cb, false);\n } else if (el.attachEvent) {\n el.attachEvent('on' + handlerBaseName, cb);\n }\n },\n\n /**\n * Listens to captured events on a DOM node.\n *\n * @see `EventListener.listen` for params.\n * @throws Exception if addEventListener is not supported.\n */\n capture: function(el, handlerBaseName, cb) {\n if (!el.addEventListener) {\n if (true) {\n console.error(\n 'You are attempting to use addEventlistener ' +\n 'in a browser that does not support it support it.' +\n 'This likely means that you will not receive events that ' +\n 'your application relies on (such as scroll).');\n }\n return;\n } else {\n el.addEventListener(handlerBaseName, cb, true);\n }\n }\n};\n\nmodule.exports = EventListener;\n\nrequire(\"./mock-modules\").register(\"EventListener\", module);\n",
"ReactEventEmitterMixin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactEventEmitterMixin\n */\n\n\"use strict\";\n\nvar EventPluginHub = require(\"./EventPluginHub\");\nvar ReactUpdates = require(\"./ReactUpdates\");\n\nfunction runEventQueueInBatch(events) {\n EventPluginHub.enqueueEvents(events);\n EventPluginHub.processEventQueue();\n}\n\nvar ReactEventEmitterMixin = {\n /**\n * Whether or not `ensureListening` has been invoked.\n * @type {boolean}\n * @private\n */\n _isListening: false,\n\n /**\n * Function, must be implemented. Listens to events on the top level of the\n * application.\n *\n * @abstract\n *\n * listenAtTopLevel: null,\n */\n\n /**\n * Ensures that top-level event delegation listeners are installed.\n *\n * There are issues with listening to both touch events and mouse events on\n * the top-level, so we make the caller choose which one to listen to. (If\n * there's a touch top-level listeners, anchors don't receive clicks for some\n * reason, and only in some cases).\n *\n * @param {*} config Configuration passed through to `listenAtTopLevel`.\n */\n ensureListening: function(config) {\n if (!config.contentDocument._reactIsListening) {\n this.listenAtTopLevel(config.touchNotMouse, config.contentDocument);\n config.contentDocument._reactIsListening = true;\n }\n },\n\n /**\n * Streams a fired top-level event to `EventPluginHub` where plugins have the\n * opportunity to create `ReactEvent`s to be dispatched.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {object} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native environment event.\n */\n handleTopLevel: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent) {\n var events = EventPluginHub.extractEvents(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n );\n\n // Event queue being processed in the same cycle allows `preventDefault`.\n ReactUpdates.batchedUpdates(runEventQueueInBatch, events);\n }\n};\n\nmodule.exports = ReactEventEmitterMixin;\n\nrequire(\"./mock-modules\").register(\"ReactEventEmitterMixin\", module);\n",
"ViewportMetrics":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ViewportMetrics\n */\n\n\"use strict\";\n\nvar ViewportMetrics = {\n\n currentScrollLeft: 0,\n\n currentScrollTop: 0,\n\n refreshScrollValues: function() {\n ViewportMetrics.currentScrollLeft =\n document.body.scrollLeft + document.documentElement.scrollLeft;\n ViewportMetrics.currentScrollTop =\n document.body.scrollTop + document.documentElement.scrollTop;\n }\n\n};\n\nmodule.exports = ViewportMetrics;\n\nrequire(\"./mock-modules\").register(\"ViewportMetrics\", module);\n",
"isEventSupported":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule isEventSupported\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar testNode, useHasFeature;\nif (ExecutionEnvironment.canUseDOM) {\n testNode = document.createElement('div');\n useHasFeature =\n document.implementation &&\n document.implementation.hasFeature &&\n // `hasFeature` always returns true in Firefox 19+.\n document.implementation.hasFeature('', '') !== true;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @param {?boolean} capture Check if the capture phase is supported.\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix, capture) {\n if (!testNode || (capture && !testNode.addEventListener)) {\n return false;\n }\n var element = document.createElement('div');\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = eventName in element;\n\n if (!isSupported) {\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n if (typeof element[eventName] !== 'undefined') {\n element[eventName] = undefined;\n }\n element.removeAttribute(eventName);\n }\n\n if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {\n // This is the only way to test support for the `wheel` event in IE9+.\n isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n }\n\n element = null;\n return isSupported;\n}\n\nmodule.exports = isEventSupported;\n\nrequire(\"./mock-modules\").register(\"isEventSupported\", module);\n",
"DOMChildrenOperations":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule DOMChildrenOperations\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar Danger = require(\"./Danger\");\nvar ReactMultiChildUpdateTypes = require(\"./ReactMultiChildUpdateTypes\");\n\nvar getTextContentAccessor = require(\"./getTextContentAccessor\");\n\n/**\n * The DOM property to use when setting text content.\n *\n * @type {string}\n * @private\n */\nvar textContentAccessor = getTextContentAccessor() || 'NA';\n\n/**\n * Inserts `childNode` as a child of `parentNode` at the `index`.\n *\n * @param {DOMElement} parentNode Parent node in which to insert.\n * @param {DOMElement} childNode Child node to insert.\n * @param {number} index Index at which to insert the child.\n * @internal\n */\nfunction insertChildAt(parentNode, childNode, index) {\n var childNodes = parentNode.childNodes;\n if (childNodes[index] === childNode) {\n return;\n }\n // If `childNode` is already a child of `parentNode`, remove it so that\n // computing `childNodes[index]` takes into account the removal.\n if (childNode.parentNode === parentNode) {\n parentNode.removeChild(childNode);\n }\n if (index >= childNodes.length) {\n parentNode.appendChild(childNode);\n } else {\n parentNode.insertBefore(childNode, childNodes[index]);\n }\n}\n\n/**\n * Operations for updating with DOM children.\n */\nvar DOMChildrenOperations = {\n\n dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,\n\n /**\n * Updates a component's children by processing a series of updates. The\n * update configurations are each expected to have a `parentNode` property.\n *\n * @param {array<object>} updates List of update configurations.\n * @param {array<string>} markupList List of markup strings.\n * @internal\n */\n processUpdates: function(updates, markupList) {\n var update;\n // Mapping from parent IDs to initial child orderings.\n var initialChildren = null;\n // List of children that will be moved or removed.\n var updatedChildren = null;\n\n for (var i = 0; update = updates[i]; i++) {\n if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||\n update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {\n var updatedIndex = update.fromIndex;\n var updatedChild = update.parentNode.childNodes[updatedIndex];\n var parentID = update.parentID;\n\n initialChildren = initialChildren || {};\n initialChildren[parentID] = initialChildren[parentID] || [];\n initialChildren[parentID][updatedIndex] = updatedChild;\n\n updatedChildren = updatedChildren || [];\n updatedChildren.push(updatedChild);\n }\n }\n\n var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);\n\n // Remove updated children first so that `toIndex` is consistent.\n if (updatedChildren) {\n for (var j = 0; j < updatedChildren.length; j++) {\n updatedChildren[j].parentNode.removeChild(updatedChildren[j]);\n }\n }\n\n for (var k = 0; update = updates[k]; k++) {\n switch (update.type) {\n case ReactMultiChildUpdateTypes.INSERT_MARKUP:\n insertChildAt(\n update.parentNode,\n renderedMarkup[update.markupIndex],\n update.toIndex\n );\n break;\n case ReactMultiChildUpdateTypes.MOVE_EXISTING:\n insertChildAt(\n update.parentNode,\n initialChildren[update.parentID][update.fromIndex],\n update.toIndex\n );\n break;\n case ReactMultiChildUpdateTypes.TEXT_CONTENT:\n update.parentNode[textContentAccessor] = update.textContent;\n break;\n case ReactMultiChildUpdateTypes.REMOVE_NODE:\n // Already removed by the for-loop above.\n break;\n }\n }\n }\n\n};\n\nmodule.exports = DOMChildrenOperations;\n\nrequire(\"./mock-modules\").register(\"DOMChildrenOperations\", module);\n",
"getTextContentAccessor":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getTextContentAccessor\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar contentKey = null;\n\n/**\n * Gets the key used to access text content on a DOM node.\n *\n * @return {?string} Key used to access text content.\n * @internal\n */\nfunction getTextContentAccessor() {\n if (!contentKey && ExecutionEnvironment.canUseDOM) {\n contentKey = 'innerText' in document.createElement('div') ?\n 'innerText' :\n 'textContent';\n }\n return contentKey;\n}\n\nmodule.exports = getTextContentAccessor;\n\nrequire(\"./mock-modules\").register(\"getTextContentAccessor\", module);\n",
"EventPluginUtils":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule EventPluginUtils\n */\n\n\"use strict\";\n\nvar EventConstants = require(\"./EventConstants\");\n\nvar invariant = require(\"./invariant\");\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\nfunction isEndish(topLevelType) {\n return topLevelType === topLevelTypes.topMouseUp ||\n topLevelType === topLevelTypes.topTouchEnd ||\n topLevelType === topLevelTypes.topTouchCancel;\n}\n\nfunction isMoveish(topLevelType) {\n return topLevelType === topLevelTypes.topMouseMove ||\n topLevelType === topLevelTypes.topTouchMove;\n}\nfunction isStartish(topLevelType) {\n return topLevelType === topLevelTypes.topMouseDown ||\n topLevelType === topLevelTypes.topTouchStart;\n}\n\nvar validateEventDispatches;\nif (true) {\n validateEventDispatches = function(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n\n var listenersIsArr = Array.isArray(dispatchListeners);\n var idsIsArr = Array.isArray(dispatchIDs);\n var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;\n var listenersLen = listenersIsArr ?\n dispatchListeners.length :\n dispatchListeners ? 1 : 0;\n\n invariant(\n idsIsArr === listenersIsArr && IDsLen === listenersLen,\n 'EventPluginUtils: Invalid `event`.'\n );\n };\n}\n\n/**\n * Invokes `cb(event, listener, id)`. Avoids using call if no scope is\n * provided. The `(listener,id)` pair effectively forms the \"dispatch\" but are\n * kept separate to conserve memory.\n */\nfunction forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}\n\n/**\n * Default implementation of PluginModule.executeDispatch().\n * @param {SyntheticEvent} SyntheticEvent to handle\n * @param {function} Application-level callback\n * @param {string} domID DOM id to pass to the callback.\n */\nfunction executeDispatch(event, listener, domID) {\n listener(event, domID);\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event, executeDispatch) {\n forEachEventDispatch(event, executeDispatch);\n event._dispatchListeners = null;\n event._dispatchIDs = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches, but stops\n * at the first dispatch execution returning true, and returns that id.\n *\n * @return id of the first dispatch execution who's listener returns true, or\n * null if no listener returned true.\n */\nfunction executeDispatchesInOrderStopAtTrue(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return The return value of executing the single dispatch.\n */\nfunction executeDirectDispatch(event) {\n if (true) {\n validateEventDispatches(event);\n }\n var dispatchListener = event._dispatchListeners;\n var dispatchID = event._dispatchIDs;\n invariant(\n !ArraLine truncated
"accumulate":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule accumulate\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Accumulates items that must not be null or undefined.\n *\n * This is used to conserve memory by avoiding array allocations.\n *\n * @return {*|array<*>} An accumulation of items.\n */\nfunction accumulate(current, next) {\n invariant(\n next != null,\n 'accumulate(...): Accumulated items must be not be null or undefined.'\n );\n if (current == null) {\n return next;\n } else {\n // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n var currentIsArray = Array.isArray(current);\n var nextIsArray = Array.isArray(next);\n if (currentIsArray) {\n return current.concat(next);\n } else {\n if (nextIsArray) {\n return [current].concat(next);\n } else {\n return [current, next];\n }\n }\n }\n}\n\nmodule.exports = accumulate;\n\nrequire(\"./mock-modules\").register(\"accumulate\", module);\n",
"forEachAccumulated":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule forEachAccumulated\n */\n\n\"use strict\";\n\n/**\n * @param {array} an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n */\nvar forEachAccumulated = function(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n};\n\nmodule.exports = forEachAccumulated;\n\nrequire(\"./mock-modules\").register(\"forEachAccumulated\", module);\n",
"TouchEventUtils":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule TouchEventUtils\n */\n\nvar TouchEventUtils = {\n /**\n * Utility function for common case of extracting out the primary touch from a\n * touch event.\n * - `touchEnd` events usually do not have the `touches` property.\n * http://stackoverflow.com/questions/3666929/\n * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed\n *\n * @param {Event} nativeEvent Native event that may or may not be a touch.\n * @return {TouchesObject?} an object with pageX and pageY or null.\n */\n extractSingleTouch: function(nativeEvent) {\n var touches = nativeEvent.touches;\n var changedTouches = nativeEvent.changedTouches;\n var hasTouches = touches && touches.length > 0;\n var hasChangedTouches = changedTouches && changedTouches.length > 0;\n\n return !hasTouches && hasChangedTouches ? changedTouches[0] :\n hasTouches ? touches[0] :\n nativeEvent;\n }\n};\n\nmodule.exports = TouchEventUtils;\n\nrequire(\"./mock-modules\").register(\"TouchEventUtils\", module);\n",
"SyntheticUIEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticUIEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\n/**\n * @interface UIEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar UIEventInterface = {\n view: null,\n detail: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);\n\nmodule.exports = SyntheticUIEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticUIEvent\", module);\n",
"CSSProperty":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule CSSProperty\n */\n\n\"use strict\";\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n fillOpacity: true,\n fontWeight: true,\n lineHeight: true,\n opacity: true,\n orphans: true,\n zIndex: true,\n zoom: true\n};\n\n/**\n * Most style properties can be unset by doing .style[prop] = '' but IE8\n * doesn't like doing that with shorthand properties so for the properties that\n * IE8 breaks on, which are listed here, we instead unset each of the\n * individual properties. See http://bugs.jquery.com/ticket/12385.\n * The 4-value 'clock' properties like margin, padding, border-width seem to\n * behave without any problems. Curiously, list-style works too without any\n * special prodding.\n */\nvar shorthandPropertyExpansions = {\n background: {\n backgroundImage: true,\n backgroundPosition: true,\n backgroundRepeat: true,\n backgroundColor: true\n },\n border: {\n borderWidth: true,\n borderStyle: true,\n borderColor: true\n },\n borderBottom: {\n borderBottomWidth: true,\n borderBottomStyle: true,\n borderBottomColor: true\n },\n borderLeft: {\n borderLeftWidth: true,\n borderLeftStyle: true,\n borderLeftColor: true\n },\n borderRight: {\n borderRightWidth: true,\n borderRightStyle: true,\n borderRightColor: true\n },\n borderTop: {\n borderTopWidth: true,\n borderTopStyle: true,\n borderTopColor: true\n },\n font: {\n fontStyle: true,\n fontVariant: true,\n fontWeight: true,\n fontSize: true,\n lineHeight: true,\n fontFamily: true\n }\n};\n\nvar CSSProperty = {\n isUnitlessNumber: isUnitlessNumber,\n shorthandPropertyExpansions: shorthandPropertyExpansions\n};\n\nmodule.exports = CSSProperty;\n\nrequire(\"./mock-modules\").register(\"CSSProperty\", module);\n",
"dangerousStyleValue":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule dangerousStyleValue\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar CSSProperty = require(\"./CSSProperty\");\n\n/**\n * Convert a value into the proper css writable value. The `styleName` name\n * name should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} styleName CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(styleName, value) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n if (isEmpty) {\n return '';\n }\n\n var isNonNumeric = isNaN(value);\n if (isNonNumeric || value === 0 || CSSProperty.isUnitlessNumber[styleName]) {\n return '' + value; // cast to string\n }\n\n return value + 'px';\n}\n\nmodule.exports = dangerousStyleValue;\n\nrequire(\"./mock-modules\").register(\"dangerousStyleValue\", module);\n",
"hyphenate":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule hyphenate\n * @typechecks\n */\n\nvar _uppercasePattern = /([A-Z])/g;\n\n/**\n * Hyphenates a camelcased string, for example:\n *\n * > hyphenate('backgroundColor')\n * < \"background-color\"\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenate(string) {\n return string.replace(_uppercasePattern, '-$1').toLowerCase();\n}\n\nmodule.exports = hyphenate;\n\nrequire(\"./mock-modules\").register(\"hyphenate\", module);\n",
"createNodesFromMarkup":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule createNodesFromMarkup\n * @typechecks\n */\n\n/*jslint evil: true, sub: true */\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar createArrayFrom = require(\"./createArrayFrom\");\nvar getMarkupWrap = require(\"./getMarkupWrap\");\nvar invariant = require(\"./invariant\");\n\n/**\n * Dummy container used to render all markup.\n */\nvar dummyNode =\n ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;\n\n/**\n * Pattern used by `getNodeName`.\n */\nvar nodeNamePattern = /^\\s*<(\\w+)/;\n\n/**\n * Extracts the `nodeName` of the first element in a string of markup.\n *\n * @param {string} markup String of markup.\n * @return {?string} Node name of the supplied markup.\n */\nfunction getNodeName(markup) {\n var nodeNameMatch = markup.match(nodeNamePattern);\n return nodeNameMatch && nodeNameMatch[1].toLowerCase();\n}\n\n/**\n * Creates an array containing the nodes rendered from the supplied markup. The\n * optionally supplied `handleScript` function will be invoked once for each\n * <script> element that is rendered. If no `handleScript` function is supplied,\n * an exception is thrown if any <script> elements are rendered.\n *\n * @param {string} markup A string of valid HTML markup.\n * @param {?function} handleScript Invoked once for each rendered <script>.\n * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.\n */\nfunction createNodesFromMarkup(markup, handleScript) {\n var node = dummyNode;\n invariant(!!dummyNode, 'createNodesFromMarkup dummy not initialized');\n var nodeName = getNodeName(markup);\n\n var wrap = nodeName && getMarkupWrap(nodeName);\n if (wrap) {\n node.innerHTML = wrap[1] + markup + wrap[2];\n\n var wrapDepth = wrap[0];\n while (wrapDepth--) {\n node = node.lastChild;\n }\n } else {\n node.innerHTML = markup;\n }\n\n var scripts = node.getElementsByTagName('script');\n if (scripts.length) {\n invariant(\n handleScript,\n 'createNodesFromMarkup(...): Unexpected <script> element rendered.'\n );\n createArrayFrom(scripts).forEach(handleScript);\n }\n\n var nodes = createArrayFrom(node.childNodes);\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n return nodes;\n}\n\nmodule.exports = createNodesFromMarkup;\n\nrequire(\"./mock-modules\").register(\"createNodesFromMarkup\", module);\n",
"getMarkupWrap":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getMarkupWrap\n */\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Dummy container used to detect which wraps are necessary.\n */\nvar dummyNode =\n ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;\n\n/**\n * Some browsers cannot use `innerHTML` to render certain elements standalone,\n * so we wrap them, render the wrapped nodes, then extract the desired node.\n *\n * In IE8, certain elements cannot render alone, so wrap all elements ('*').\n */\nvar shouldWrap = {\n // Force wrapping for SVG elements because if they get created inside a <div>,\n // they will be initialized in the wrong namespace (and will not display).\n 'circle': true,\n 'g': true,\n 'line': true,\n 'path': true,\n 'polyline': true,\n 'rect': true,\n 'text': true\n};\n\nvar selectWrap = [1, '<select multiple=\"true\">', '</select>'];\nvar tableWrap = [1, '<table>', '</table>'];\nvar trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nvar svgWrap = [1, '<svg>', '</svg>'];\n\nvar markupWrap = {\n '*': [1, '?<div>', '</div>'],\n\n 'area': [1, '<map>', '</map>'],\n 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n 'legend': [1, '<fieldset>', '</fieldset>'],\n 'param': [1, '<object>', '</object>'],\n 'tr': [2, '<table><tbody>', '</tbody></table>'],\n\n 'optgroup': selectWrap,\n 'option': selectWrap,\n\n 'caption': tableWrap,\n 'colgroup': tableWrap,\n 'tbody': tableWrap,\n 'tfoot': tableWrap,\n 'thead': tableWrap,\n\n 'td': trWrap,\n 'th': trWrap,\n\n 'circle': svgWrap,\n 'g': svgWrap,\n 'line': svgWrap,\n 'path': svgWrap,\n 'polyline': svgWrap,\n 'rect': svgWrap,\n 'text': svgWrap\n};\n\n/**\n * Gets the markup wrap configuration for the supplied `nodeName`.\n *\n * NOTE: This lazily detects which wraps are necessary for the current browser.\n *\n * @param {string} nodeName Lowercase `nodeName`.\n * @return {?array} Markup wrap configuration, if applicable.\n */\nfunction getMarkupWrap(nodeName) {\n invariant(!!dummyNode, 'Markup wrapping node not initialized');\n if (!markupWrap.hasOwnProperty(nodeName)) {\n nodeName = '*';\n }\n if (!shouldWrap.hasOwnProperty(nodeName)) {\n if (nodeName === '*') {\n dummyNode.innerHTML = '<link />';\n } else {\n dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';\n }\n shouldWrap[nodeName] = !dummyNode.firstChild;\n }\n return shouldWrap[nodeName] ? markupWrap[nodeName] : null;\n}\n\n\nmodule.exports = getMarkupWrap;\n\nrequire(\"./mock-modules\").register(\"getMarkupWrap\", module);\n",
"filterAttributes":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule filterAttributes\n * @typechecks static-only\n */\n\n/*jslint evil: true */\n\n'use strict';\n\n/**\n * Like filter(), but for a DOM nodes attributes. Returns an array of\n * the filter DOMAttribute objects. Does some perf related this like\n * caching attributes.length.\n *\n * @param {DOMElement} node Node whose attributes you want to filter\n * @return {array} array of DOM attribute objects.\n */\nfunction filterAttributes(node, func, context) {\n var attributes = node.attributes;\n var numAttributes = attributes.length;\n var accumulator = [];\n for (var i = 0; i < numAttributes; i++) {\n var attr = attributes.item(i);\n if (func.call(context, attr)) {\n accumulator.push(attr);\n }\n }\n return accumulator;\n}\n\nmodule.exports = filterAttributes;\n\nrequire(\"./mock-modules\").register(\"filterAttributes\", module);\n",
"copyProperties":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule copyProperties\n */\n\n/**\n * Copy properties from one or more objects (up to 5) into the first object.\n * This is a shallow copy. It mutates the first object and also returns it.\n *\n * NOTE: `arguments` has a very significant performance penalty, which is why\n * we don't support unlimited arguments.\n */\nfunction copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (true) {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}\n\nmodule.exports = copyProperties;\n\nrequire(\"./mock-modules\").register(\"copyProperties\", module);\n",
"adler32":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule adler32\n */\n\n/* jslint bitwise:true */\n\n\"use strict\";\n\nvar MOD = 65521;\n\n// This is a clean-room implementation of adler32 designed for detecting\n// if markup is not what we expect it to be. It does not need to be\n// cryptographically strong, only reasonable good at detecting if markup\n// generated on the server is different than that on the client.\nfunction adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}\n\nmodule.exports = adler32;\n\nrequire(\"./mock-modules\").register(\"adler32\", module);\n",
"getEventTarget":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getEventTarget\n * @typechecks static-only\n */\n\n\"use strict\";\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\nfunction getEventTarget(nativeEvent) {\n var target = nativeEvent.target || nativeEvent.srcElement || window;\n // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n // @see http://www.quirksmode.org/js/events_properties.html\n return target.nodeType === 3 ? target.parentNode : target;\n}\n\nmodule.exports = getEventTarget;\n\nrequire(\"./mock-modules\").register(\"getEventTarget\", module);\n",
"SyntheticMouseEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticMouseEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\nvar ViewportMetrics = require(\"./ViewportMetrics\");\n\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar MouseEventInterface = {\n screenX: null,\n screenY: null,\n clientX: null,\n clientY: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n button: function(event) {\n // Webkit, Firefox, IE9+\n // which: 1 2 3\n // button: 0 1 2 (standard)\n var button = event.button;\n if ('which' in event) {\n return button;\n }\n // IE<9\n // which: undefined\n // button: 0 0 0\n // button: 1 4 2 (onmouseup)\n return button === 2 ? 2 : button === 4 ? 1 : 0;\n },\n buttons: null,\n relatedTarget: function(event) {\n return event.relatedTarget || (\n event.fromElement === event.srcElement ?\n event.toElement :\n event.fromElement\n );\n },\n // \"Proprietary\" Interface.\n pageX: function(event) {\n return 'pageX' in event ?\n event.pageX :\n event.clientX + ViewportMetrics.currentScrollLeft;\n },\n pageY: function(event) {\n return 'pageY' in event ?\n event.pageY :\n event.clientY + ViewportMetrics.currentScrollTop;\n }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);\n\nmodule.exports = SyntheticMouseEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticMouseEvent\", module);\n",
"isTextInputElement":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule isTextInputElement\n */\n\n\"use strict\";\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n 'color': true,\n 'date': true,\n 'datetime': true,\n 'datetime-local': true,\n 'email': true,\n 'month': true,\n 'number': true,\n 'password': true,\n 'range': true,\n 'search': true,\n 'tel': true,\n 'text': true,\n 'time': true,\n 'url': true,\n 'week': true\n};\n\nfunction isTextInputElement(elem) {\n return elem && (\n (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]) ||\n elem.nodeName === 'TEXTAREA'\n );\n}\n\nmodule.exports = isTextInputElement;\n\nrequire(\"./mock-modules\").register(\"isTextInputElement\", module);\n",
"SyntheticClipboardEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticClipboardEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\nvar ClipboardEventInterface = {\n clipboardData: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);\n\nmodule.exports = SyntheticClipboardEvent;\n\n\nrequire(\"./mock-modules\").register(\"SyntheticClipboardEvent\", module);\n",
"SyntheticFocusEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticFocusEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar FocusEventInterface = {\n relatedTarget: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);\n\nmodule.exports = SyntheticFocusEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticFocusEvent\", module);\n",
"SyntheticKeyboardEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticKeyboardEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar KeyboardEventInterface = {\n 'char': null,\n key: null,\n location: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n repeat: null,\n locale: null,\n // Legacy Interface\n charCode: null,\n keyCode: null,\n which: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);\n\nmodule.exports = SyntheticKeyboardEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticKeyboardEvent\", module);\n",
"SyntheticTouchEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticTouchEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticUIEvent = require(\"./SyntheticUIEvent\");\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\nvar TouchEventInterface = {\n touches: null,\n targetTouches: null,\n changedTouches: null,\n altKey: null,\n metaKey: null,\n ctrlKey: null,\n shiftKey: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) {\n SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);\n\nmodule.exports = SyntheticTouchEvent;\n\nrequire(\"./mock-modules\").register(\"SyntheticTouchEvent\", module);\n",
"isNode":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule isNode\n * @typechecks\n */\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM node.\n */\nfunction isNode(object) {\n return !!(object && (\n typeof Node !== 'undefined' ? object instanceof Node :\n typeof object === 'object' &&\n typeof object.nodeType === 'number' &&\n typeof object.nodeName === 'string'\n ));\n}\n\nmodule.exports = isNode;\n\nrequire(\"./mock-modules\").register(\"isNode\", module);\n",
"ReactComponentBrowserEnvironment":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactComponentBrowserEnvironment\n */\n\n/*jslint evil: true */\n\n\"use strict\";\n\nvar ReactDOMIDOperations = require(\"./ReactDOMIDOperations\");\nvar ReactMarkupChecksum = require(\"./ReactMarkupChecksum\");\nvar ReactMount = require(\"./ReactMount\");\nvar ReactReconcileTransaction = require(\"./ReactReconcileTransaction\");\n\nvar getReactRootElementInContainer = require(\"./getReactRootElementInContainer\");\nvar invariant = require(\"./invariant\");\nvar mutateHTMLNodeWithMarkup = require(\"./mutateHTMLNodeWithMarkup\");\n\n\nvar ELEMENT_NODE_TYPE = 1;\nvar DOC_NODE_TYPE = 9;\n\n\n/**\n * Abstracts away all functionality of `ReactComponent` requires knowledge of\n * the browser context.\n */\nvar ReactComponentBrowserEnvironment = {\n /**\n * Mixed into every component instance.\n */\n Mixin: {\n /**\n * Returns the DOM node rendered by this component.\n *\n * @return {DOMElement} The root node of this component.\n * @final\n * @protected\n */\n getDOMNode: function() {\n invariant(\n this.isMounted(),\n 'getDOMNode(): A component must be mounted to have a DOM node.'\n );\n return ReactMount.getNode(this._rootNodeID);\n }\n },\n\n ReactReconcileTransaction: ReactReconcileTransaction,\n\n DOMIDOperations: ReactDOMIDOperations,\n\n /**\n * If a particular environment requires that some resources be cleaned up,\n * specify this in the injected Mixin. In the DOM, we would likely want to\n * purge any cached node ID lookups.\n *\n * @private\n */\n unmountIDFromEnvironment: function(rootNodeID) {\n ReactMount.purgeID(rootNodeID);\n },\n\n /**\n * @param {string} markup Markup string to place into the DOM Element.\n * @param {DOMElement} container DOM Element to insert markup into.\n * @param {boolean} shouldReuseMarkup Should reuse the existing markup in the\n * container if possible.\n */\n mountImageIntoNode: function(markup, container, shouldReuseMarkup) {\n invariant(\n container && (\n container.nodeType === ELEMENT_NODE_TYPE ||\n container.nodeType === DOC_NODE_TYPE && ReactMount.allowFullPageRender\n ),\n 'mountComponentIntoNode(...): Target container is not valid.'\n );\n if (shouldReuseMarkup) {\n if (ReactMarkupChecksum.canReuseMarkup(\n markup,\n getReactRootElementInContainer(container))) {\n return;\n } else {\n if (true) {\n console.warn(\n 'React attempted to use reuse markup in a container but the ' +\n 'checksum was invalid. This generally means that you are using ' +\n 'server rendering and the markup generated on the server was ' +\n 'not what the client was expecting. React injected new markup ' +\n 'to compensate which works but you have lost many of the ' +\n 'benefits of server rendering. Instead, figure out why the ' +\n 'markup being generated is different on the client or server.'\n );\n }\n }\n }\n\n // You can't naively set the innerHTML of the entire document. You need\n // to mutate documentElement which requires doing some crazy tricks. See\n // mutateHTMLNodeWithMarkup()\n if (container.nodeType === DOC_NODE_TYPE) {\n mutateHTMLNodeWithMarkup(container.documentElement, markup);\n return;\n }\n\n // Asynchronously inject markup by ensuring that the container is not in\n // the document when settings its `innerHTML`.\n var parent = container.parentNode;\n if (parent) {\n var next = container.nextSibling;\n parent.removeChild(container);\n container.innerHTML = markup;\n if (next) {\n parent.insertBefore(container, next);\n } else {\n parent.appendChild(container);\n }\n } else {\n container.innerHTML = markup;\n }\n }\n};\n\nmodule.exports = ReactComponentBrowserEnvironment;\n\nrequire(\"./mock-modules\").register(\"ReactComponentBrowserEnvironment\", module);\n",
"ge":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ge\n */\n\n/**\n * Find a node by ID. Optionally search a sub-tree outside of the document\n *\n * Use ge if you're not sure whether or not the element exists. You can test\n * for existence yourself in your application code.\n *\n * If your application code depends on the existence of the element, use $\n * instead, which will throw in DEV if the element doesn't exist.\n */\nfunction ge(arg, root, tag) {\n return typeof arg != 'string' ? arg :\n !root ? document.getElementById(arg) :\n _geFromSubtree(arg, root, tag);\n}\n\nfunction _geFromSubtree(id, root, tag) {\n var elem, children, ii;\n\n if (_getNodeID(root) == id) {\n return root;\n } else if (root.getElementsByTagName) {\n // All Elements implement this, which does an iterative DFS, which is\n // faster than recursion and doesn't run into stack depth issues.\n children = root.getElementsByTagName(tag || '*');\n for (ii = 0; ii < children.length; ii++) {\n if (_getNodeID(children[ii]) == id) {\n return children[ii];\n }\n }\n } else {\n // DocumentFragment does not implement getElementsByTagName, so\n // recurse over its children. Its children must be Elements, so\n // each child will use the getElementsByTagName case instead.\n children = root.childNodes;\n for (ii = 0; ii < children.length; ii++) {\n elem = _geFromSubtree(id, children[ii]);\n if (elem) {\n return elem;\n }\n }\n }\n\n return null;\n}\n\n/**\n * Return the ID value for a given node. This allows us to avoid issues\n * with forms that contain inputs with name=\"id\".\n *\n * @return string (null if attribute not set)\n */\nfunction _getNodeID(node) {\n // #document and #document-fragment do not have getAttributeNode.\n var id = node.getAttributeNode && node.getAttributeNode('id');\n return id ? id.value : null;\n}\n\nmodule.exports = ge;\n\nrequire(\"./mock-modules\").register(\"ge\", module);\n",
"isTextNode":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule isTextNode\n * @typechecks\n */\n\nvar isNode = require(\"./isNode\");\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM text node.\n */\nfunction isTextNode(object) {\n return isNode(object) && object.nodeType == 3;\n}\n\nmodule.exports = isTextNode;\n\nrequire(\"./mock-modules\").register(\"isTextNode\", module);\n",
"ReactDOMSelection":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule ReactDOMSelection\n */\n\n\"use strict\";\n\nvar getNodeForCharacterOffset = require(\"./getNodeForCharacterOffset\");\nvar getTextContentAccessor = require(\"./getTextContentAccessor\");\n\n/**\n * Get the appropriate anchor and focus node/offset pairs for IE.\n *\n * The catch here is that IE's selection API doesn't provide information\n * about whether the selection is forward or backward, so we have to\n * behave as though it's always forward.\n *\n * IE text differs from modern selection in that it behaves as though\n * block elements end with a new line. This means character offsets will\n * differ between the two APIs.\n *\n * @param {DOMElement} node\n * @return {object}\n */\nfunction getIEOffsets(node) {\n var selection = document.selection;\n var selectedRange = selection.createRange();\n var selectedLength = selectedRange.text.length;\n\n // Duplicate selection so we can move range without breaking user selection.\n var fromStart = selectedRange.duplicate();\n fromStart.moveToElementText(node);\n fromStart.setEndPoint('EndToStart', selectedRange);\n\n var startOffset = fromStart.text.length;\n var endOffset = startOffset + selectedLength;\n\n return {\n start: startOffset,\n end: endOffset\n };\n}\n\n/**\n * @param {DOMElement} node\n * @return {?object}\n */\nfunction getModernOffsets(node) {\n var selection = window.getSelection();\n\n if (selection.rangeCount === 0) {\n return null;\n }\n\n var anchorNode = selection.anchorNode;\n var anchorOffset = selection.anchorOffset;\n var focusNode = selection.focusNode;\n var focusOffset = selection.focusOffset;\n\n var currentRange = selection.getRangeAt(0);\n var rangeLength = currentRange.toString().length;\n\n var tempRange = currentRange.cloneRange();\n tempRange.selectNodeContents(node);\n tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);\n\n var start = tempRange.toString().length;\n var end = start + rangeLength;\n\n // Detect whether the selection is backward.\n var detectionRange = document.createRange();\n detectionRange.setStart(anchorNode, anchorOffset);\n detectionRange.setEnd(focusNode, focusOffset);\n var isBackward = detectionRange.collapsed;\n detectionRange.detach();\n\n return {\n start: isBackward ? end : start,\n end: isBackward ? start : end\n };\n}\n\n/**\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setIEOffsets(node, offsets) {\n var range = document.selection.createRange().duplicate();\n var start, end;\n\n if (typeof offsets.end === 'undefined') {\n start = offsets.start;\n end = start;\n } else if (offsets.start > offsets.end) {\n start = offsets.end;\n end = offsets.start;\n } else {\n start = offsets.start;\n end = offsets.end;\n }\n\n range.moveToElementText(node);\n range.moveStart('character', start);\n range.setEndPoint('EndToStart', range);\n range.moveEnd('character', end - start);\n range.select();\n}\n\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setModernOffsets(node, offsets) {\n var selection = window.getSelection();\n\n var length = node[getTextContentAccessor()].length;\n var start = Math.min(offsets.start, length);\n var end = typeof offsets.end === 'undefined' ?\n start : Math.min(offsets.end, length);\n\n var startMarker = getNodeForCharacterOffset(node, start);\n var endMarker = getNodeForCharacterOffset(node, end);\n\n if (startMarker && endMarker) {\n var range = document.createRange();\n range.setStart(startMarker.node, startMarker.offset);\n selection.removeAllRanges();\n selection.addRange(range);\n selection.extend(endMarker.node, endMarker.offset);\n range.detach();\n }\n}\n\nvar ReactDOMSelection = {\n /**\n * @param {DOMElement} node\n */\n getOffsets: function(node) {\n var getOffsets = document.selection ? getIEOffsets : getModernOffsets;\n return getOffsets(node) Line truncated
"getActiveElement":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule getActiveElement\n * @typechecks\n */\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n */\nfunction getActiveElement() /*?DOMElement*/ {\n try {\n return document.activeElement;\n } catch (e) {\n return null;\n }\n}\n\nmodule.exports = getActiveElement;\n\n\nrequire(\"./mock-modules\").register(\"getActiveElement\", module);\n",
"LinkedValueMixin":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule LinkedValueMixin\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar invariant = require(\"./invariant\");\n\n/**\n * Provide a linked `value` attribute for controlled forms. You should not use\n * this outside of the ReactDOM controlled form components.\n */\nvar LinkedValueMixin = {\n _assertLink: function() {\n invariant(\n this.props.value == null && this.props.onChange == null,\n 'Cannot provide a valueLink and a value or onChange event. If you ' +\n 'want to use value or onChange, you probably don\\'t want to use ' +\n 'valueLink'\n );\n },\n\n /**\n * @return {*} current value of the input either from value prop or link.\n */\n getValue: function() {\n if (this.props.valueLink) {\n this._assertLink();\n return this.props.valueLink.value;\n }\n return this.props.value;\n },\n\n /**\n * @return {function} change callback either from onChange prop or link.\n */\n getOnChange: function() {\n if (this.props.valueLink) {\n this._assertLink();\n return this._handleLinkedValueChange;\n }\n return this.props.onChange;\n },\n\n /**\n * @param {SyntheticEvent} e change event to handle\n */\n _handleLinkedValueChange: function(e) {\n this.props.valueLink.requestChange(e.target.value);\n }\n};\n\nmodule.exports = LinkedValueMixin;\n\nrequire(\"./mock-modules\").register(\"LinkedValueMixin\", module);\n",
"SyntheticCompositionEvent":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule SyntheticCompositionEvent\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar SyntheticEvent = require(\"./SyntheticEvent\");\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar CompositionEventInterface = {\n data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticCompositionEvent(\n dispatchConfig,\n dispatchMarker,\n nativeEvent) {\n SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);\n}\n\nSyntheticEvent.augmentClass(\n SyntheticCompositionEvent,\n CompositionEventInterface\n);\n\nmodule.exports = SyntheticCompositionEvent;\n\n\nrequire(\"./mock-modules\").register(\"SyntheticCompositionEvent\", module);\n",
"shallowEqual":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule shallowEqual\n */\n\n\"use strict\";\n\n/**\n * Performs equality by iterating through keys on an object and returning\n * false when any key has values which are not strictly equal between\n * objA and objB. Returns true when the values of all keys are strictly equal.\n *\n * @return {boolean}\n */\nfunction shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n var key;\n // Test for A's keys different from B.\n for (key in objA) {\n if (objA.hasOwnProperty(key) &&\n (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {\n return false;\n }\n }\n // Test for B'a keys missing from A.\n for (key in objB) {\n if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = shallowEqual;\n\nrequire(\"./mock-modules\").register(\"shallowEqual\", module);\n",
"performanceNow":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule performanceNow\n * @typechecks static-only\n */\n\n\"use strict\";\n\nvar ExecutionEnvironment = require(\"./ExecutionEnvironment\");\n\n/**\n * Detect if we can use window.performance.now() and gracefully\n * fallback to Date.now() if it doesn't exist.\n * We need to support Firefox < 15 for now due to Facebook's webdriver\n * infrastructure.\n */\nvar performance = null;\n\nif (ExecutionEnvironment.canUseDOM) {\n performance = window.performance || window.webkitPerformance;\n}\n\nif (!performance || !performance.now) {\n performance = Date;\n}\n\nvar performanceNow = performance.now.bind(performance);\n\nmodule.exports = performanceNow;\n\nrequire(\"./mock-modules\").register(\"performanceNow\", module);\n",
"createArrayFrom":"/**\n * Copyright 2013 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule createArrayFrom\n * @typechecks\n */\n\n/**\n * NOTE: if you are a previous user of this function, it has been considered\n * unsafe because it's inconsistent across browsers for some inputs.\n * Instead use `Array.isArray()`.\n *\n * Perform a heuristic test to determine if an object is \"array-like\".\n *\n * A monk asked Joshu, a Zen master, \"Has a dog Buddha nature?\"\n * Joshu replied: \"Mu.\"\n *\n * This function determines if its argument has \"array nature\": it returns\n * true if the argument is an actual array, an `arguments' object, or an\n * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).\n *\n * @param {*} obj\n * @return {boolean}\n */\nfunction hasArrayNature(obj) {\n return (\n // not null/false\n !!obj &&\n // arrays are objects, NodeLists are functions in Safari\n (typeof obj == 'object' || typeof obj == 'function') &&\n // quacks like an array\n ('length' in obj) &&\n // not window\n !('setInterval' in obj) &&\n // no DOM node should be considered an array-like\n // a 'select' element has 'length' and 'item' properties on IE8\n (typeof obj.nodeType != 'number') &&\n (\n // a real array\n (// HTMLCollection/NodeList\n (Array.isArray(obj) ||\n // arguments\n ('callee' in obj) || 'item' in obj))\n )\n );\n}\n\n/**\n * Ensure that the argument is an array by wrapping it in an array if it is not.\n * Creates a copy of the argument if it is already an array.\n *\n * This is mostly useful idiomatically:\n *\n * var createArrayFrom = require('createArrayFrom');\n *\n * function takesOneOrMoreThings(things) {\n * things = createArrayFrom(things);\n * ...\n * }\n *\n * This allows you to treat `things' as an array, but accept scalars in the API.\n *\n * This is also good for converting certain pseudo-arrays, like `arguments` or\n * HTMLCollections, into arrays.\n *\n * @param {*} obj\n * @return {array}\n */\nfunction createArrayFrom(obj) {\n if (!hasArrayNature(obj)) {\n return [obj];\n }\n if (obj.item) {\n // IE does not support Array#slice on HTMLCollections\n var l = obj.length, ret = new Array(l);\n while (l--) { ret[l] = obj[l]; }\n return ret;\n }\n return Array.prototype.slice.call(obj);\n}\n\nmodule.exports = createArrayFrom;\n\nrequire(\"./mock-modules\").register(\"createArrayFrom\", module);\n"
});
+14277
View File
File diff suppressed because it is too large. Load diff
+62
View File
@@ -0,0 +1,62 @@
// Generated by "grunt/tasks/populist.js" at "2013-10-28T20:57:24.999Z"
harness.enableTest("addons/link/__tests__/LinkedStateMixin-test");
harness.enableTest("addons/transitions/__tests__/ReactTransitionGroup-test");
harness.enableTest("addons/transitions/__tests__/ReactTransitionKeySet-test");
harness.enableTest("addons/transitions/__tests__/ReactTransitionableChild-test");
harness.enableTest("core/__tests__/ReactBind-test");
harness.enableTest("core/__tests__/ReactComponent-test");
harness.enableTest("core/__tests__/ReactComponentLifeCycle-test");
harness.enableTest("core/__tests__/ReactCompositeComponent-test");
harness.enableTest("core/__tests__/ReactCompositeComponentDOMMinimalism-test");
harness.enableTest("core/__tests__/ReactCompositeComponentMixin-test");
harness.enableTest("core/__tests__/ReactCompositeComponentSpec-test");
harness.enableTest("core/__tests__/ReactCompositeComponentState-test");
harness.enableTest("core/__tests__/ReactDOM-test");
harness.enableTest("core/__tests__/ReactDOMComponent-test");
harness.enableTest("core/__tests__/ReactDOMIDOperations-test");
harness.enableTest("core/__tests__/ReactEventEmitter-test");
harness.enableTest("core/__tests__/ReactIdentity-test");
harness.enableTest("core/__tests__/ReactInstanceHandles-test");
harness.enableTest("core/__tests__/ReactMount-test");
harness.enableTest("core/__tests__/ReactMountDestruction-test");
harness.enableTest("core/__tests__/ReactMultiChild-test");
harness.enableTest("core/__tests__/ReactMultiChildReconcile-test");
harness.enableTest("core/__tests__/ReactMultiChildText-test");
harness.enableTest("core/__tests__/ReactPropTransferer-test");
harness.enableTest("core/__tests__/ReactPropTypes-test");
harness.enableTest("core/__tests__/ReactRenderDocument-test");
harness.enableTest("core/__tests__/ReactStateSetters-test");
harness.enableTest("core/__tests__/ReactUpdates-test");
harness.enableTest("core/__tests__/refs-destruction-test");
harness.enableTest("core/__tests__/refs-test");
harness.enableTest("dom/__tests__/CSSPropertyOperations-test");
harness.enableTest("dom/__tests__/DOMPropertyOperations-test");
harness.enableTest("dom/__tests__/Danger-test");
harness.enableTest("dom/__tests__/getNodeForCharacterOffset-test");
harness.enableTest("dom/__tests__/mutateHTMLNodeWithMarkup-test");
harness.enableTest("dom/components/__tests__/ReactDOMButton-test");
harness.enableTest("dom/components/__tests__/ReactDOMInput-test");
harness.enableTest("dom/components/__tests__/ReactDOMSelect-test");
harness.enableTest("dom/components/__tests__/ReactDOMTextarea-test");
harness.enableTest("environment/__tests__/ReactServerRendering-test");
harness.enableTest("environment/__tests__/ReactWebWorker-test");
harness.enableTest("event/__tests__/EventPluginRegistry-test");
harness.enableTest("event/synthetic/__tests__/SyntheticEvent-test");
harness.enableTest("event/synthetic/__tests__/SyntheticWheelEvent-test");
harness.enableTest("eventPlugins/__tests__/AnalyticsEventPlugin-test");
harness.enableTest("eventPlugins/__tests__/ResponderEventPlugin-test");
harness.enableTest("utils/__tests__/ImmutableObject-test");
harness.enableTest("utils/__tests__/OrderedMap-test");
harness.enableTest("utils/__tests__/ReactChildren-test");
harness.enableTest("utils/__tests__/Transaction-test");
harness.enableTest("utils/__tests__/escapeTextForBrowser-test");
harness.enableTest("utils/__tests__/joinClasses-test");
harness.enableTest("utils/__tests__/keyMirror-test");
harness.enableTest("utils/__tests__/memoizeStringOnly-test");
harness.enableTest("utils/__tests__/mergeFuncs-test");
harness.enableTest("utils/__tests__/onlyChild-test");
harness.enableTest("utils/__tests__/sliceChildren-test");
harness.enableTest("utils/__tests__/traverseAllChildren-test");
harness.enableTest("vendor/error/__tests__/erx-test");
harness.enableTest("vendor/error/__tests__/ex-test");