babel-plugin-transform-es2015-computed-properties
Advanced tools
Comparing version 7.0.0-alpha.15 to 7.0.0-alpha.16
@@ -8,3 +8,2 @@ "use strict"; | ||
template = _ref.template; | ||
var buildMutatorMapAssign = template("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n "); | ||
@@ -33,6 +32,5 @@ | ||
scope = _ref2.scope; | ||
var key = !prop.computed && t.isIdentifier(prop.key) ? t.stringLiteral(prop.key.name) : prop.key; | ||
var maybeMemoise = scope.maybeGenerateMemoised(key); | ||
var maybeMemoise = scope.maybeGenerateMemoised(key); | ||
if (maybeMemoise) { | ||
@@ -80,3 +78,2 @@ body.push(t.expressionStatement(t.assignmentExpression("=", maybeMemoise, key))); | ||
for (var _iterator2 = computedProps, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
@@ -95,3 +92,2 @@ var _ref4; | ||
var prop = _ref4; | ||
var key = t.toComputedKey(prop); | ||
@@ -101,3 +97,5 @@ | ||
pushMutatorDefine(info, prop); | ||
} else if (t.isStringLiteral(key, { value: "__proto__" })) { | ||
} else if (t.isStringLiteral(key, { | ||
value: "__proto__" | ||
})) { | ||
pushAssign(objId, prop, body); | ||
@@ -121,23 +119,12 @@ } else { | ||
scope = path.scope; | ||
var hasComputed = false; | ||
for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref5; | ||
var _arr = node.properties; | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref5 = _iterator3[_i3++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref5 = _i3.value; | ||
} | ||
var prop = _ref5; | ||
for (var _i3 = 0; _i3 < _arr.length; _i3++) { | ||
var prop = _arr[_i3]; | ||
hasComputed = prop.computed === true; | ||
if (hasComputed) break; | ||
} | ||
if (!hasComputed) return; | ||
var initProps = []; | ||
@@ -147,15 +134,15 @@ var computedProps = []; | ||
for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { | ||
var _ref6; | ||
for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref5; | ||
if (_isArray4) { | ||
if (_i4 >= _iterator4.length) break; | ||
_ref6 = _iterator4[_i4++]; | ||
if (_isArray3) { | ||
if (_i4 >= _iterator3.length) break; | ||
_ref5 = _iterator3[_i4++]; | ||
} else { | ||
_i4 = _iterator4.next(); | ||
_i4 = _iterator3.next(); | ||
if (_i4.done) break; | ||
_ref6 = _i4.value; | ||
_ref5 = _i4.value; | ||
} | ||
var _prop = _ref6; | ||
var _prop = _ref5; | ||
@@ -176,8 +163,5 @@ if (_prop.computed) { | ||
var body = []; | ||
body.push(t.variableDeclaration("var", [t.variableDeclarator(objId, initPropExpression)])); | ||
var callback = spec; | ||
if (state.opts.loose) callback = loose; | ||
var mutatorRef = void 0; | ||
@@ -188,3 +172,2 @@ | ||
mutatorRef = scope.generateUidIdentifier("mutatorMap"); | ||
body.push(t.variableDeclaration("var", [t.variableDeclarator(mutatorRef, t.objectExpression([]))])); | ||
@@ -191,0 +174,0 @@ } |
{ | ||
"name": "babel-plugin-transform-es2015-computed-properties", | ||
"version": "7.0.0-alpha.15", | ||
"version": "7.0.0-alpha.16", | ||
"description": "Compile ES2015 computed properties to ES5", | ||
@@ -12,7 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-computed-properties", | ||
"dependencies": { | ||
"babel-template": "7.0.0-alpha.15" | ||
"babel-template": "7.0.0-alpha.16" | ||
}, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.15" | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.16" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8352
163
+ Addedansi-styles@3.2.1(transitive)
+ Addedbabel-code-frame@7.0.0-alpha.16(transitive)
+ Addedbabel-helper-function-name@7.0.0-alpha.16(transitive)
+ Addedbabel-helper-get-function-arity@7.0.0-alpha.16(transitive)
+ Addedbabel-messages@7.0.0-alpha.16(transitive)
+ Addedbabel-template@7.0.0-alpha.16(transitive)
+ Addedbabel-traverse@7.0.0-alpha.16(transitive)
+ Addedbabel-types@7.0.0-alpha.16(transitive)
+ Addedbabylon@7.0.0-beta.17(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedglobals@10.4.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedbabel-code-frame@7.0.0-alpha.15(transitive)
- Removedbabel-helper-function-name@7.0.0-alpha.15(transitive)
- Removedbabel-helper-get-function-arity@7.0.0-alpha.15(transitive)
- Removedbabel-messages@7.0.0-alpha.15(transitive)
- Removedbabel-template@7.0.0-alpha.15(transitive)
- Removedbabel-traverse@7.0.0-alpha.15(transitive)
- Removedbabel-types@7.0.0-alpha.15(transitive)
- Removedbabylon@7.0.0-beta.13(transitive)
- Removedchalk@1.1.3(transitive)
- Removedglobals@9.18.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedto-fast-properties@1.0.3(transitive)