Comparing version 0.8.0 to 0.8.1
@@ -815,6 +815,5 @@ /* | ||
properties.push({ | ||
type: 'Property', | ||
key: { | ||
type: 'Identifier', | ||
value: name | ||
name: name | ||
}, | ||
@@ -1373,3 +1372,3 @@ value: value | ||
function parseVariableDeclaration() { | ||
var token, name; | ||
var token, id, init; | ||
@@ -1382,20 +1381,17 @@ token = lex(); | ||
} | ||
name = token.value; | ||
id = { | ||
type: Syntax.Identifier, | ||
name: token.value | ||
}; | ||
init = null; | ||
if (match('=')) { | ||
lex(); | ||
return { | ||
type: Syntax.AssignmentExpression, | ||
operator: '=', | ||
left: { | ||
type: Syntax.Identifier, | ||
name: name | ||
}, | ||
right: parseAssignmentExpression() | ||
}; | ||
init = parseAssignmentExpression(); | ||
} | ||
return { | ||
type: Syntax.Identifier, | ||
name: name | ||
id: id, | ||
init: init | ||
}; | ||
@@ -1429,3 +1425,4 @@ } | ||
type: Syntax.VariableDeclaration, | ||
declarations: declarations | ||
declarations: declarations, | ||
kind: 'var' | ||
}; | ||
@@ -1840,2 +1837,4 @@ } | ||
return parseBlock(); | ||
case '(': | ||
return parseExpressionStatement(); | ||
default: | ||
@@ -1881,2 +1880,13 @@ break; | ||
if (stat.expression.type === Syntax.FunctionExpression) { | ||
if (stat.expression.id !== null) { | ||
return { | ||
type: Syntax.FunctionDeclaration, | ||
id: stat.expression.id, | ||
params: stat.expression.params, | ||
body: stat.expression.body | ||
}; | ||
} | ||
} | ||
// 12.12 Labelled Statements | ||
@@ -1906,3 +1916,6 @@ if ((stat.expression.type === Syntax.Identifier) && match(':')) { | ||
} | ||
id = token.value; | ||
id = { | ||
type: Syntax.Identifier, | ||
name: token.value | ||
}; | ||
@@ -1950,3 +1963,6 @@ expect(Token.Punctuator, '('); | ||
} | ||
id = token.value; | ||
id = { | ||
type: Syntax.Identifier, | ||
name: token.value | ||
}; | ||
} | ||
@@ -2031,4 +2047,4 @@ | ||
// Sync with package.json. | ||
exports.version = '0.8.0'; | ||
exports.version = '0.8.1'; | ||
}(typeof exports === 'undefined' ? (esprima = {}) : exports)); |
{ | ||
"name": "esprima", | ||
"description": "ECMAScript parsing infrastructure for multipurpose analysis tool", | ||
"description": "ECMAScript parsing infrastructure for multipurpose analysis", | ||
"homepage": "http://esprima.org", | ||
@@ -9,3 +9,3 @@ "main": "esprima.js", | ||
}, | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"engines": { | ||
@@ -12,0 +12,0 @@ "node": ">=0.4.0" |
@@ -24,3 +24,8 @@ /*jslint browser: true */ | ||
'parsejs mootools-1.4.1', | ||
'zeparser mootools-1.4.1' | ||
'zeparser mootools-1.4.1', | ||
'esprima ext-core-3.1.0', | ||
'narcissus ext-core-3.1.0', | ||
'parsejs ext-core-3.1.0', | ||
'zeparser ext-core-3.1.0' | ||
]; | ||
@@ -27,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
3321923
30
14328