chore: rename isgenerator for is_generator

This commit is contained in:
Darío Javier Cravero 2016-04-10 19:58:32 +01:00
parent 81c788e8ab
commit f038e89ee0
4 changed files with 7 additions and 7 deletions

View File

@ -437,10 +437,10 @@ var AST_ArrowParametersOrSeq = DEFNODE("ArrowParametersOrSeq", "expressions", {
} }
}); });
var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments isgenerator", { var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments is_generator", {
$documentation: "Base class for functions", $documentation: "Base class for functions",
$propdoc: { $propdoc: {
isgenerator: "is generatorFn or not", is_generator: "is generatorFn or not",
name: "[AST_SymbolDeclaration?] the name of this function", name: "[AST_SymbolDeclaration?] the name of this function",
argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion*] array of function arguments, destructurings, or expanding arguments", argnames: "[AST_SymbolFunarg|AST_Destructuring|AST_Expansion*] array of function arguments, destructurings, or expanding arguments",
uses_arguments: "[boolean/S] tells whether this function accesses the arguments array" uses_arguments: "[boolean/S] tells whether this function accesses the arguments array"

View File

@ -788,7 +788,7 @@ function OutputStream(options) {
var self = this; var self = this;
if (!nokeyword) { if (!nokeyword) {
output.print("function"); output.print("function");
if (this.isgenerator) { if (this.is_generator) {
output.star(); output.star();
} }
if (self.name) { if (self.name) {

View File

@ -1052,8 +1052,8 @@ function parse($TEXT, options) {
var start = S.token var start = S.token
var in_statement = ctor === AST_Defun; var in_statement = ctor === AST_Defun;
var isgenerator = is("operator", "*"); var is_generator = is("operator", "*");
if (isgenerator) { if (is_generator) {
next(); next();
} }
@ -1066,7 +1066,7 @@ function parse($TEXT, options) {
return new ctor({ return new ctor({
start : args.start, start : args.start,
end : body.end, end : body.end,
isgenerator: isgenerator, is_generator: is_generator,
name : name, name : name,
argnames: args, argnames: args,
body : body body : body

View File

@ -121,7 +121,7 @@ module.exports = function () {
// generators // generators
var generators_def = UglifyJS.parse('function* fn() {}').body[0]; var generators_def = UglifyJS.parse('function* fn() {}').body[0];
ok.equal(generators_def.isgenerator, true); ok.equal(generators_def.is_generator, true);
ok.throws(function () { ok.throws(function () {
UglifyJS.parse('function* (){ }'); UglifyJS.parse('function* (){ }');