react 0.13.0-rc1 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,7 +141,8 @@ var ReactFragment = {
141
141
  ("production" !== process.env.NODE_ENV ? warning(
142
142
  didWarnForFragment(fragment),
143
143
  'Any use of a keyed object should be wrapped in ' +
144
- 'React.addons.createFragment(object) before passed as a child.'
144
+ 'React.addons.createFragment(object) before being passed as a ' +
145
+ 'child.'
145
146
  ) : null);
146
147
  return fragment;
147
148
  }
@@ -12,6 +12,7 @@
12
12
  'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
+ var ReactFragment = require("./ReactFragment");
15
16
  var ReactPropTypeLocationNames = require("./ReactPropTypeLocationNames");
16
17
 
17
18
  var emptyFunction = require("./emptyFunction");
@@ -291,6 +292,7 @@ function isNode(propValue) {
291
292
  switch (typeof propValue) {
292
293
  case 'number':
293
294
  case 'string':
295
+ case 'undefined':
294
296
  return true;
295
297
  case 'boolean':
296
298
  return !propValue;
@@ -298,9 +300,10 @@ function isNode(propValue) {
298
300
  if (Array.isArray(propValue)) {
299
301
  return propValue.every(isNode);
300
302
  }
301
- if (ReactElement.isValidElement(propValue)) {
303
+ if (propValue === null || ReactElement.isValidElement(propValue)) {
302
304
  return true;
303
305
  }
306
+ propValue = ReactFragment.extractIfFragment(propValue);
304
307
  for (var k in propValue) {
305
308
  if (!isNode(propValue[k])) {
306
309
  return false;
@@ -86,7 +86,6 @@ var ReactReconciler = {
86
86
  }
87
87
 
88
88
  var refsChanged = ReactRef.shouldUpdateRefs(
89
- this,
90
89
  prevElement,
91
90
  nextElement
92
91
  );
package/lib/ReactRef.js CHANGED
@@ -40,7 +40,7 @@ ReactRef.attachRefs = function(instance, element) {
40
40
  }
41
41
  };
42
42
 
43
- ReactRef.shouldUpdateRefs = function(instance, prevElement, nextElement) {
43
+ ReactRef.shouldUpdateRefs = function(prevElement, nextElement) {
44
44
  // If either the owner or a `ref` has changed, make sure the newest owner
45
45
  // has stored a reference to `this`, and the previous owner (if different)
46
46
  // has forgotten the reference to `this`. We use the element instead
@@ -65,7 +65,7 @@ var ReactTestUtils = {
65
65
  isDOMComponent: function(inst) {
66
66
  // TODO: Fix this heuristic. It's just here because composites can currently
67
67
  // pretend to be DOM components.
68
- return !!(inst && inst.getDOMNode && inst.tagName);
68
+ return !!(inst && inst.tagName && inst.getDOMNode);
69
69
  },
70
70
 
71
71
  isDOMComponentElement: function(inst) {
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @typechecks
9
+ * @typechecks static-only
10
10
  * @providesModule cloneWithProps
11
11
  */
12
12
 
@@ -33,6 +33,7 @@ function createFullPageComponent(tag) {
33
33
  var elementFactory = ReactElement.createFactory(tag);
34
34
 
35
35
  var FullPageComponent = ReactClass.createClass({
36
+ tagName: tag.toUpperCase(),
36
37
  displayName: 'ReactFullPageComponent' + tag,
37
38
 
38
39
  componentWillUnmount: function() {
@@ -40,6 +40,7 @@ assign(
40
40
  function isInternalComponentType(type) {
41
41
  return (
42
42
  typeof type === 'function' &&
43
+ typeof type.prototype !== 'undefined' &&
43
44
  typeof type.prototype.mountComponent === 'function' &&
44
45
  typeof type.prototype.receiveComponent === 'function'
45
46
  );
package/lib/update.js CHANGED
@@ -9,11 +9,14 @@
9
9
  * @providesModule update
10
10
  */
11
11
 
12
+ /* global hasOwnProperty:true */
13
+
12
14
  'use strict';
13
15
 
14
16
  var assign = require("./Object.assign");
15
17
  var keyOf = require("./keyOf");
16
18
  var invariant = require("./invariant");
19
+ var hasOwnProperty = {}.hasOwnProperty;
17
20
 
18
21
  function shallowCopy(x) {
19
22
  if (Array.isArray(x)) {
@@ -73,7 +76,7 @@ function update(value, spec) {
73
76
  COMMAND_SET
74
77
  ) : invariant(typeof spec === 'object'));
75
78
 
76
- if (spec.hasOwnProperty(COMMAND_SET)) {
79
+ if (hasOwnProperty.call(spec, COMMAND_SET)) {
77
80
  ("production" !== process.env.NODE_ENV ? invariant(
78
81
  Object.keys(spec).length === 1,
79
82
  'Cannot have more than one key in an object with %s',
@@ -85,7 +88,7 @@ function update(value, spec) {
85
88
 
86
89
  var nextValue = shallowCopy(value);
87
90
 
88
- if (spec.hasOwnProperty(COMMAND_MERGE)) {
91
+ if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
89
92
  var mergeObj = spec[COMMAND_MERGE];
90
93
  ("production" !== process.env.NODE_ENV ? invariant(
91
94
  mergeObj && typeof mergeObj === 'object',
@@ -102,21 +105,21 @@ function update(value, spec) {
102
105
  assign(nextValue, spec[COMMAND_MERGE]);
103
106
  }
104
107
 
105
- if (spec.hasOwnProperty(COMMAND_PUSH)) {
108
+ if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
106
109
  invariantArrayCase(value, spec, COMMAND_PUSH);
107
110
  spec[COMMAND_PUSH].forEach(function(item) {
108
111
  nextValue.push(item);
109
112
  });
110
113
  }
111
114
 
112
- if (spec.hasOwnProperty(COMMAND_UNSHIFT)) {
115
+ if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
113
116
  invariantArrayCase(value, spec, COMMAND_UNSHIFT);
114
117
  spec[COMMAND_UNSHIFT].forEach(function(item) {
115
118
  nextValue.unshift(item);
116
119
  });
117
120
  }
118
121
 
119
- if (spec.hasOwnProperty(COMMAND_SPLICE)) {
122
+ if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
120
123
  ("production" !== process.env.NODE_ENV ? invariant(
121
124
  Array.isArray(value),
122
125
  'Expected %s target to be an array; got %s',
@@ -142,7 +145,7 @@ function update(value, spec) {
142
145
  });
143
146
  }
144
147
 
145
- if (spec.hasOwnProperty(COMMAND_APPLY)) {
148
+ if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
146
149
  ("production" !== process.env.NODE_ENV ? invariant(
147
150
  typeof spec[COMMAND_APPLY] === 'function',
148
151
  'update(): expected spec of %s to be a function; got %s.',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.13.0-rc1",
4
+ "version": "0.13.2",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],