{"_id":"doc-en-react-8faba1735f6b2d17744137e2793573e876d08674a943e100ee050b84816a75af","title":"","text":"function getJSReport(browser){ return browser .waitForCondition(\"typeof window.jasmine != 'undefined'\", 5e3) .waitFor(wd.asserters.jsCondition(\"typeof window.jasmine != 'undefined'\"), 5e3, 50) .fail(function(error){ throw Error(\"The test page didn't load properly. \" + error); }) .waitForCondition(\"typeof window.jasmine.getJSReport != 'undefined'\", 10e3) .waitForCondition(\"window.postDataToURL.running <= 0\", 30e3) .waitFor(wd.asserters.jsCondition(\"typeof window.jasmine.getJSReport != 'undefined'\"), 60e3, 100) .waitFor(wd.asserters.jsCondition(\"window.postDataToURL.running <= 0\"), 30e3, 500) .eval(\"jasmine.getJSReport().passed\"); }"}
{"_id":"doc-en-react-4734459bb16532eb5aafa8f3bbb5dd04693fbfbd22abcd7e1fb13c89b20cc667","title":"","text":"urls.unshift('../node_modules/es5-shim/es5-shim.js'); } var cacheBust = '?_=' + Date.now().toString(36); var cacheBust = '?_=' + (+new Date).toString(36); for (var urls_index = -1, urls_length = urls.length; ++urls_index < urls_length;) { document.write('');"}
{"_id":"doc-en-react-3007f0673be52064524a00db56e1c9591a291cecd9b1d55e789410281772ed12","title":"","text":"* @protected */ setState: function(partialState, callback) { invariant( typeof partialState === 'object' || partialState == null, 'setState(...): takes an object of state variables to update.' ); if (__DEV__){ if (partialState == null) { console.warn( 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().' ); } } // Merge with `_pendingState` if it exists, otherwise with existing state. this.replaceState( merge(this._pendingState || this.state, partialState),"}
{"_id":"doc-en-react-bf5798b90c09f75d39944d2b957e97fc266706845ce1d800e084eabfffafd0d5","title":"","text":"checkMergeArrayArgs: function(one, two) { invariant( Array.isArray(one) && Array.isArray(two), 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' 'Tried to merge arrays, instead got %s and %s.', one, two ); },"}
{"_id":"doc-en-react-27ce1f5c9dc1f4b83ec14da9bdb62fb7c8e671e4406e25c42cdaee2a7bc06ea0","title":"","text":"checkMergeObjectArg: function(arg) { invariant( !isTerminal(arg) && !Array.isArray(arg), 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' 'Tried to merge an object, instead got %s.', arg ); },"}
{"_id":"doc-en-react-cec87f280fa9de2093b22995f60bc68c6f34138f838f6de2034bd3beca51ce39","title":"","text":"* CSS properties which accept numbers but are not in units of \"px\". */ var isUnitlessNumber = { columnCount: true, fillOpacity: true, flex: true, flexGrow: true, flexShrink: true, fontWeight: true, lineHeight: true, opacity: true, order: true, orphans: true, pitchRange: true, richness: true, stress: true, volume: true, widows: true, zIndex: true, zoom: true };"}
{"_id":"doc-en-react-50d5598a1ecf06b53398ae235a982412740b4603ea301eacccd3469d4802bd3d","title":"","text":"}); it('should not append `px` to styles that might need a number', function() { expect(CSSPropertyOperations.createMarkupForStyles({ fillOpacity: 1, fontWeight: 2, opacity: 3, orphans: 4, zIndex: 5, zoom: 6, lineHeight: 7 })).toBe( 'fill-opacity:1;font-weight:2;opacity:3;orphans:4;z-index:5;zoom:6;' + 'line-height:7;' ); var unitlessProperties = [ 'columnCount', 'fillOpacity', 'flex', 'flexGrow', 'flexShrink', 'fontWeight', 'lineHeight', 'opacity', 'order', 'orphans', 'pitchRange', 'richness', 'stress', 'volume', 'widows', 'zIndex', 'zoom' ]; unitlessProperties.forEach(function(property) { var styles = {}; styles[property] = 1; expect(CSSPropertyOperations.createMarkupForStyles(styles)) .toMatch(/:1;$/); }); }); it('should set style attribute when styles exist', function() {"}
{"_id":"doc-en-react-67f9022d491ffeba0e3f72f5cd6879bf0df3b76370ab9dbcfaf7a50cc425e302","title":"","text":"\"url\": \"https://github.com/facebook/react\" }, \"dependencies\": { \"commoner\": \"~0.8.14\", \"commoner\": \"~0.9.0\", \"esprima-fb\": \"~2001.1001.0-dev-harmony-fb\", \"jstransform\": \"~2.0.2\" },"}
{"_id":"doc-en-react-86fa3b086bf47779ea8ba228dbf7f456a53f187ff313c418f4b2489d7df5dac8","title":"","text":"var mocks = require('mocks'); var ExecutionEnvironment; var React; var ReactMarkupChecksum; var ReactMount; var ReactReconcileTransaction; var ReactTestUtils; var ReactServerRendering; var ReactMarkupChecksum; var ExecutionEnvironment; var ID_ATTRIBUTE_NAME;"}
{"_id":"doc-en-react-8c6664b9dd18238c386e8388cca596d050fb9e678aa76b4b382edadcadedbbca","title":"","text":"beforeEach(function() { require('mock-modules').dumpCache(); React = require('React'); ReactMarkupChecksum = require('ReactMarkupChecksum'); ReactMount = require('ReactMount'); ReactTestUtils = require('ReactTestUtils'); ReactReconcileTransaction = require('ReactReconcileTransaction'); ExecutionEnvironment = require('ExecutionEnvironment'); ExecutionEnvironment.canUseDOM = false; ReactServerRendering = require('ReactServerRendering'); ReactMarkupChecksum = require('ReactMarkupChecksum'); var DOMProperty = require('DOMProperty'); ID_ATTRIBUTE_NAME = DOMProperty.ID_ATTRIBUTE_NAME;"}
{"_id":"doc-en-react-e4c9f26c4e027620bdc25234dd0ae617a2ff1a3f0a3e30f84a9348766a1ebba4","title":"","text":"'a valid ReactComponent.' ); }); it('allows setState in componentWillMount without using DOM', function() { var Component = React.createClass({ componentWillMount: function() { this.setState({text: 'hello, world'}); }, render: function() { return * **Duplicated data from props:** Try to use props as the source of truth where possible. Because props can change over time, it's appropriate to store props in state to be able to know its previous values. * **Duplicated data from props:** Try to use props as the source of truth where possible. One valid use to store props in state is to be able to know it's previous values, because props can change over time. "}
{"_id":"doc-en-react-e4f795e1235ca92806e674ac5b38f4fc9f8c66b295cbefb2ad5b77e4d6552175","title":"","text":"invariant( one[key] === undefined, 'mergeObjectsWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: %s', 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key ); one[key] = value;"}
{"_id":"doc-en-react-4134d81734458406d3b456b46dcc61bd82b5668ca375b3bf775b2c2bb168855a","title":"","text":"instance = ReactTestUtils.renderIntoDocument(instance); }).toThrow( 'Invariant Violation: mergeObjectsWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: x' 'Tried to merge two objects with the same key: `x`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.' ); });"}
{"_id":"doc-en-react-d664c9c45770d6e9f28a6f5e6e8e0d6090c2c2e680103ebecfb53a558305bce9","title":"","text":" /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @emails react-core */ 'use strict'; require('mock-modules') .dontMock('shallowEqual'); var shallowEqual; describe('shallowEqual', function() { beforeEach(function() { shallowEqual = require('shallowEqual'); }); it('returns false if either argument is null', function() { expect(shallowEqual(null, {})).toBe(false); expect(shallowEqual({}, null)).toBe(false); }); it('returns true if both arguments are null or undefined', function() { expect(shallowEqual(null, null)).toBe(true); expect(shallowEqual(undefined, undefined)).toBe(true); }); it('returns true if arguments are shallow equal', function() { expect( shallowEqual( {a: 1, b: 2, c: 3}, {a: 1, b: 2, c: 3} ) ).toBe(true); }); it('returns false if first argument has too many keys', function() { expect( shallowEqual( {a: 1, b: 2, c: 3}, {a: 1, b: 2} ) ).toBe(false); }); it('returns false if second argument has too many keys', function() { expect( shallowEqual( {a: 1, b: 2}, {a: 1, b: 2, c: 3} ) ).toBe(false); }); it('returns false if arguments are not shallow equal', function() { expect( shallowEqual( {a: 1, b: 2, c: {}}, {a: 1, b: 2, c: {}} ) ).toBe(false); }); }); "}
{"_id":"doc-en-react-8f0f6eb1846a5dbcf8f6f26b72dbb7162700a5dbaaede96d44f06a563947b22e","title":"","text":"if (objA === objB) { return true; } if (!objA || !objB) { return false; } var key; // Test for A's keys different from B. for (key in objA) {"}
{"_id":"doc-en-react-89f6ad41bb608aa76e5bfa8a414adf2c3657357b5cf38c787f2ac010ca54b5d1","title":"","text":"