Comparing version 0.1.6 to 0.1.7
@@ -102,4 +102,2 @@ # Features | ||
var obj = { | ||
bar: "foobar", | ||
foo() { | ||
@@ -110,7 +108,7 @@ return "foobar"; | ||
get bar() { | ||
return this._bar; | ||
}, | ||
set bar() { | ||
set bar(val) { | ||
this._bar = val; | ||
} | ||
@@ -136,3 +134,3 @@ }; | ||
}); | ||
}; | ||
} | ||
``` | ||
@@ -139,0 +137,0 @@ |
@@ -120,5 +120,3 @@ var traverse = require("../traverse"); | ||
var templateName = "function-call"; | ||
if (traverse.hasType(node, "ThisExpression")) { | ||
templateName = "function-call-this"; | ||
} | ||
if (traverse.hasType(node, "ThisExpression")) templateName += "-this"; | ||
@@ -125,0 +123,0 @@ // |
@@ -1,6 +0,9 @@ | ||
var util = require("../util"); | ||
var _ = require("lodash"); | ||
var traverse = require("../traverse"); | ||
var util = require("../util"); | ||
var _ = require("lodash"); | ||
exports.ObjectExpression = function (node) { | ||
var hasComputed = false; | ||
var hasThis = false; | ||
var computed = []; | ||
@@ -12,2 +15,3 @@ | ||
computed.unshift(prop); | ||
if (!hasThis) hasThis = traverse.hasType(prop, "ThisExpression"); | ||
return false; | ||
@@ -21,8 +25,18 @@ } else { | ||
var container = util.template("function-return-obj", { | ||
var templateName = "function-return-obj"; | ||
if (hasThis) templateName += "-this"; | ||
var container = util.template(templateName, { | ||
OBJECT: node | ||
}); | ||
var containerBody; | ||
if (templateName === "function-return-obj") { | ||
containerBody = container.callee.body.body; | ||
} else { | ||
containerBody = container.callee.object.body.body; | ||
} | ||
_.each(computed, function (prop) { | ||
container.callee.body.body.unshift(util.template("obj-key-set", { | ||
containerBody.unshift(util.template("obj-key-set", { | ||
KEY: prop.key, | ||
@@ -29,0 +43,0 @@ VALUE: prop.value |
{ | ||
"name": "6to5", | ||
"description": "Turn ES6 code into vanilla ES5 with source maps and no runtime", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
@@ -20,4 +20,20 @@ "homepage": "https://github.com/sebmck/6to5", | ||
}, | ||
"keywords": [ | ||
"es6-transpiler", | ||
"scope", | ||
"harmony", | ||
"blockscope", | ||
"block-scope", | ||
"let", | ||
"const", | ||
"var", | ||
"es6", | ||
"transpile", | ||
"transpiler", | ||
"traceur", | ||
"6to5" | ||
], | ||
"scripts": { | ||
"test": "mocha" | ||
"bench": "make bench", | ||
"test": "make test" | ||
}, | ||
@@ -36,5 +52,10 @@ "dependencies": { | ||
"devDependencies": { | ||
"es6-transpiler": "0.7.17", | ||
"istanbul": "0.3.2", | ||
"matcha": "0.5.0", | ||
"mocha": "1.21.4", | ||
"istanbul": "0.3.2" | ||
"traceur": "0.0.66", | ||
"esnext": "0.11.1", | ||
"es6now": "0.8.11" | ||
} | ||
} |
@@ -188,8 +188,47 @@ <p align="center"> | ||
## Comparison to Traceur | ||
## Comparison to other transpilers | ||
6to5 is different to Traceur in a few very distinct ways. | ||
| | 6to5 | Traceur | esnext | es6now | es6-transpiler | | ||
| -------------------------- | ---- | ------- | ------ | ------ | -------------- | | ||
| No runtime | ✓ | | | | ✓ | | ||
| Source maps | ✓ | ✓ | ✓ | | ✓ | | ||
| **Compiler usage:** | | | | | | | ||
| No global pollution | ✓ | | ✓ | | ✓ | | ||
| **Syntax features:** | | | | | | | ||
| Array comprehension | ✓ | ✓ | ✓ | | ✓ | | ||
| Arrow functions | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Block binding | ✓ | ✓ | | | ✓ | | ||
| Classes | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Computed property names | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Constants | ✓ | ✓ | | | ✓ | | ||
| Default parameters | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Destructuring | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| For-of | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Generator comprehension | | ✓ | ✓ | | ✓ | | ||
| Generators | | ✓ | ✓ | | | | ||
| Modules | ✓ | ✓ | | ✓ | | | ||
| Property method assignment | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Property name shorthand | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Rest parameters | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Spread | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Template literals | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
### Runtime | ||
#### Performance | ||
$ make bench | ||
##### Output size (including runtime) | ||
Lower is better. | ||
![Output size graph](http://i.imgur.com/cHMdnM9.png) | ||
##### Compile speed | ||
Higher is better. | ||
![Compile speed graph](http://i.imgur.com/YYx2R8O.png) | ||
### [Traceur](https://github.com/google/traceur-compiler) | ||
Traceur requires quite a bulky runtime (~75KB) and produces quite verbose code. | ||
@@ -199,6 +238,17 @@ While this can be trimmed down by selectively building the runtime, it's an | ||
Instead of mapping to a runtime, 6to5 maps directly to the equivalent ES5. This | ||
means that your transpiled code will be as simple as possible and is | ||
**exactly** the equivalent ES5. | ||
### [esnext](https://github.com/esnext/esnext) | ||
### Performance | ||
esnext is **slow**, painfully so. Runtime required. | ||
### [es6now](https://github.com/zenparsing/es6now) | ||
Doesn't output sourcemaps. This is cited as a positive as line-to-line mapping | ||
is the goal. This however obviously doesn't retain column mapping resulting in | ||
the output code not being very pleasant. | ||
### [es6-transpiler](https://github.com/termi/es6-transpiler) | ||
es6-transpiler requires shims to compile and pollutes the global scope resulting | ||
in possible collisions. es6-transpiler maps line-by-line, just like es6now, this | ||
results in the same issues such as lack of column information and unpleasant | ||
code output. |
@@ -1,1 +0,1 @@ | ||
{"arguments-slice-assign-arg":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"},{"type":"Identifier","name":"SLICE_ARG"}]}}],"kind":"var"}],"comments":[]},"arguments-slice-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"}]}}],"kind":"var"}],"comments":[]},"arguments-slice":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"}]}}],"comments":[]},"array-comprehension-container":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"rest":null,"generator":false,"expression":false},"arguments":[]}}],"comments":[]},"array-comprehension-filter":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"filter"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FILTER"}}]},"rest":null,"generator":false,"expression":false}]},"property":{"type":"Identifier","name":"map"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"STATEMENT"}}]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-comprehension-for-each":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"forEach"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-comprehension-map":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"map"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"STATEMENT"}}]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-concat":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"ArrayExpression","elements":[]},"property":{"type":"Identifier","name":"concat"}},"arguments":[{"type":"Identifier","name":"ARGUMENT"}]}}],"comments":[]},"array-push":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"KEY"},"property":{"type":"Identifier","name":"push"}},"arguments":[{"type":"Identifier","name":"STATEMENT"}]}}],"comments":[]},"assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"KEY"},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"class-method":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"METHOD_NAME"}},"right":{"type":"Identifier","name":"FUNCTION"}}}],"comments":[]},"class":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"CLASS_NAME"},"init":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"CLASS_NAME"},"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[]},"rest":null,"generator":false,"expression":false},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"CLASS_NAME"}}]},"rest":null,"generator":false,"expression":false},"arguments":[]}}],"kind":"var"}],"comments":[]},"exports-alias-var":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"}},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Identifier","name":"STRING_KEY"},{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"get"},"value":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"rest":null,"generator":false,"expression":false},"kind":"init","method":false,"shorthand":false,"computed":false}]}]}}],"comments":[]},"exports-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"KEY"}},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"exports-default":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"exports"},"right":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"module"},"property":{"type":"Identifier","name":"exports"}},"right":{"type":"Identifier","name":"VALUE"}}}}],"comments":[]},"exports-require-assign-key":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"VARIABLE_NAME"}},"right":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"}}}}],"comments":[]},"exports-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"i"}},"right":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"i"}}}}]},"each":false}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}]}}],"comments":[]},"for-of":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_KEY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"}}},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"STEP_KEY"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","argument":{"type":"MemberExpression","computed":false,"object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"STEP_KEY"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Identifier","name":"next"}},"arguments":[]}},"property":{"type":"Identifier","name":"done"}},"prefix":true},"update":null,"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"STEP_KEY"},"property":{"type":"Identifier","name":"value"}}}],"kind":"var"}]}}],"comments":[]},"function-bind-this":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"FUNCTION"},"property":{"type":"Identifier","name":"bind"}},"arguments":[{"type":"ThisExpression"}]}}],"comments":[]},"function-call-this":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"FUNCTION"},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"ThisExpression"}]}}],"comments":[]},"function-call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"FUNCTION"},"arguments":[]}}],"comments":[]},"function-return-obj":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}],"comments":[]},"if-undefined-set-to":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","operator":"===","left":{"type":"Identifier","name":"VARIABLE"},"right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"VARIABLE"},"right":{"type":"Identifier","name":"DEFAULT"}}},"alternate":null}],"comments":[]},"if":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"STATEMENT"},"consequent":{"type":"BlockStatement","body":[]},"alternate":null}],"comments":[]},"inherits":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"create"}},"arguments":[{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"SUPER_NAME"},"property":{"type":"Identifier","name":"prototype"}},{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"constructor"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"CLASS_NAME"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":false,"raw":"false"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true,"raw":"true"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true,"raw":"true"},"kind":"init","method":false,"shorthand":false,"computed":false}]},"kind":"init","method":false,"shorthand":false,"computed":false}]}]}}}],"comments":[]},"obj-key-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"KEY"}},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"object-define-properties-closure":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"CONTENT"}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}],"comments":[]},"object-define-properties":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperties"}},"arguments":[{"type":"Identifier","name":"OBJECT"},{"type":"Identifier","name":"PROPS"}]}}],"comments":[]},"prototype-identifier":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}}}],"comments":[]},"require-assign-key":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"}}}],"kind":"var"}],"comments":[]},"require-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}}],"kind":"var"}],"comments":[]},"variable-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Identifier","name":"VALUE"}}],"kind":"var"}],"comments":[]},"variable-declare":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":null}],"kind":"var"}],"comments":[]}} | ||
{"arguments-slice-assign-arg":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"},{"type":"Identifier","name":"SLICE_ARG"}]}}],"kind":"var"}],"comments":[]},"arguments-slice-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"}]}}],"kind":"var"}],"comments":[]},"arguments-slice":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"slice"}},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"Identifier","name":"arguments"}]}}],"comments":[]},"array-comprehension-container":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"rest":null,"generator":false,"expression":false},"arguments":[]}}],"comments":[]},"array-comprehension-filter":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"filter"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FILTER"}}]},"rest":null,"generator":false,"expression":false}]},"property":{"type":"Identifier","name":"map"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"STATEMENT"}}]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-comprehension-for-each":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"forEach"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-comprehension-map":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"map"}},"arguments":[{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"KEY"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"STATEMENT"}}]},"rest":null,"generator":false,"expression":false}]}}],"comments":[]},"array-concat":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"ArrayExpression","elements":[]},"property":{"type":"Identifier","name":"concat"}},"arguments":[{"type":"Identifier","name":"ARGUMENT"}]}}],"comments":[]},"array-push":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"KEY"},"property":{"type":"Identifier","name":"push"}},"arguments":[{"type":"Identifier","name":"STATEMENT"}]}}],"comments":[]},"assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"KEY"},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"class-method":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}},"property":{"type":"Identifier","name":"METHOD_NAME"}},"right":{"type":"Identifier","name":"FUNCTION"}}}],"comments":[]},"class":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"CLASS_NAME"},"init":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"CLASS_NAME"},"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[]},"rest":null,"generator":false,"expression":false},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"CLASS_NAME"}}]},"rest":null,"generator":false,"expression":false},"arguments":[]}}],"kind":"var"}],"comments":[]},"exports-alias-var":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"}},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Identifier","name":"STRING_KEY"},{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"get"},"value":{"type":"FunctionExpression","id":null,"params":[],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"rest":null,"generator":false,"expression":false},"kind":"init","method":false,"shorthand":false,"computed":false}]}]}}],"comments":[]},"exports-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"KEY"}},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"exports-default":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"exports"},"right":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"module"},"property":{"type":"Identifier","name":"exports"}},"right":{"type":"Identifier","name":"VALUE"}}}}],"comments":[]},"exports-require-assign-key":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"VARIABLE_NAME"}},"right":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"}}}}],"comments":[]},"exports-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"i"}},"right":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"i"}}}}]},"each":false}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}]}}],"comments":[]},"for-of":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_KEY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"}}},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"STEP_KEY"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","argument":{"type":"MemberExpression","computed":false,"object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"STEP_KEY"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Identifier","name":"next"}},"arguments":[]}},"property":{"type":"Identifier","name":"done"}},"prefix":true},"update":null,"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"STEP_KEY"},"property":{"type":"Identifier","name":"value"}}}],"kind":"var"}]}}],"comments":[]},"function-bind-this":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"FUNCTION"},"property":{"type":"Identifier","name":"bind"}},"arguments":[{"type":"ThisExpression"}]}}],"comments":[]},"function-call-this":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"FUNCTION"},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"ThisExpression"}]}}],"comments":[]},"function-call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"FUNCTION"},"arguments":[]}}],"comments":[]},"function-return-obj-this":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"rest":null,"generator":false,"expression":false},"property":{"type":"Identifier","name":"call"}},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"OBJECT"}]}}],"comments":[]},"function-return-obj":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}],"comments":[]},"if-undefined-set-to":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","operator":"===","left":{"type":"Identifier","name":"VARIABLE"},"right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"VARIABLE"},"right":{"type":"Identifier","name":"DEFAULT"}}},"alternate":null}],"comments":[]},"if":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"STATEMENT"},"consequent":{"type":"BlockStatement","body":[]},"alternate":null}],"comments":[]},"inherits":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"create"}},"arguments":[{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"SUPER_NAME"},"property":{"type":"Identifier","name":"prototype"}},{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"constructor"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"CLASS_NAME"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":false,"raw":"false"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true,"raw":"true"},"kind":"init","method":false,"shorthand":false,"computed":false},{"type":"Property","key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true,"raw":"true"},"kind":"init","method":false,"shorthand":false,"computed":false}]},"kind":"init","method":false,"shorthand":false,"computed":false}]}]}}}],"comments":[]},"obj-key-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","computed":true,"object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"KEY"}},"right":{"type":"Identifier","name":"VALUE"}}}],"comments":[]},"object-define-properties-closure":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"params":[{"type":"Identifier","name":"obj"}],"defaults":[],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"CONTENT"}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"rest":null,"generator":false,"expression":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}],"comments":[]},"object-define-properties":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperties"}},"arguments":[{"type":"Identifier","name":"OBJECT"},{"type":"Identifier","name":"PROPS"}]}}],"comments":[]},"prototype-identifier":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","computed":false,"object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"}}}],"comments":[]},"require-assign-key":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"MemberExpression","computed":false,"object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"}}}],"kind":"var"}],"comments":[]},"require-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}}],"kind":"var"}],"comments":[]},"variable-assign":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Identifier","name":"VALUE"}}],"kind":"var"}],"comments":[]},"variable-declare":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":null}],"kind":"var"}],"comments":[]}} |
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
71227
1073
253
7