react 0.13.0-rc2 → 0.13.3

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.
@@ -26,6 +26,7 @@ var ReactUpdates = require("./ReactUpdates");
26
26
  var SyntheticEvent = require("./SyntheticEvent");
27
27
 
28
28
  var assign = require("./Object.assign");
29
+ var emptyObject = require("./emptyObject");
29
30
 
30
31
  var topLevelTypes = EventConstants.topLevelTypes;
31
32
 
@@ -65,7 +66,7 @@ var ReactTestUtils = {
65
66
  isDOMComponent: function(inst) {
66
67
  // TODO: Fix this heuristic. It's just here because composites can currently
67
68
  // pretend to be DOM components.
68
- return !!(inst && inst.getDOMNode && inst.tagName);
69
+ return !!(inst && inst.tagName && inst.getDOMNode);
69
70
  },
70
71
 
71
72
  isDOMComponentElement: function(inst) {
@@ -367,6 +368,9 @@ assign(
367
368
  );
368
369
 
369
370
  ReactShallowRenderer.prototype.render = function(element, context) {
371
+ if (!context) {
372
+ context = emptyObject;
373
+ }
370
374
  var transaction = ReactUpdates.ReactReconcileTransaction.getPooled();
371
375
  this._render(element, transaction, context);
372
376
  ReactUpdates.ReactReconcileTransaction.release(transaction);
@@ -19,6 +19,7 @@ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
19
19
 
20
20
  var SVGDOMPropertyConfig = {
21
21
  Properties: {
22
+ clipPath: MUST_USE_ATTRIBUTE,
22
23
  cx: MUST_USE_ATTRIBUTE,
23
24
  cy: MUST_USE_ATTRIBUTE,
24
25
  d: MUST_USE_ATTRIBUTE,
@@ -64,6 +65,7 @@ var SVGDOMPropertyConfig = {
64
65
  y: MUST_USE_ATTRIBUTE
65
66
  },
66
67
  DOMAttributeNames: {
68
+ clipPath: 'clip-path',
67
69
  fillOpacity: 'fill-opacity',
68
70
  fontFamily: 'font-family',
69
71
  fontSize: 'font-size',
@@ -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() {
@@ -29,6 +29,7 @@ var shouldWrap = {
29
29
  // Force wrapping for SVG elements because if they get created inside a <div>,
30
30
  // they will be initialized in the wrong namespace (and will not display).
31
31
  'circle': true,
32
+ 'clipPath': true,
32
33
  'defs': true,
33
34
  'ellipse': true,
34
35
  'g': true,
@@ -71,6 +72,7 @@ var markupWrap = {
71
72
  'th': trWrap,
72
73
 
73
74
  'circle': svgWrap,
75
+ 'clipPath': svgWrap,
74
76
  'defs': svgWrap,
75
77
  'ellipse': svgWrap,
76
78
  'g': svgWrap,
@@ -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-rc2",
4
+ "version": "0.13.3",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],