152 Commits

Author SHA1 Message Date
Ingvar Stepanyan
82b9f30fc9 Allow some keywords to be treated as identifier names; update ecmaVersion in benchmark. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
eb7ccea743 Stricter tokVal -> tokType comparisons. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
3ee9e288a2 Forbid spread element in sequence expressions. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
8f96965d36 Added yield support (completed generators). 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
b8a3300a21 Added function * support (part of generators feature). 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
4f24e13fd5 Added template string support. 2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
26818e1f36 Removed module-related tests and implemented corresponding alternatives support.
`module ModuleName { ... }` was removed from spec in favor of separate files.
`module LocalName from '...'` is being replaced with `import * as LocalName from '...'` as per http://jsmodules.io/ and https://twitter.com/domenic/status/492735387140243456 (c) @domenic.
2014-07-29 14:41:29 +02:00
Ingvar Stepanyan
b38c15a94b Added export declaration support.
See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports, ariya/esprima#216, square/es6-module-transpiler#63 for latest decisions on `export default 42` vs `export default = 42` (first wins, so returning AST as it was in older Esprima Harmony and used by https://github.com/square/es6-module-transpiler/).
2014-07-29 14:41:24 +02:00
Ingvar Stepanyan
bcc97e2d52 Array Comprehensions as per latest ES6 drafts. 2014-07-29 14:41:18 +02:00
Ingvar Stepanyan
648f3159cc Added for (..of..) support and guard against for (let var=.. in|of ..) loops. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
8b0be7cec9 Improved destruction assignment guards. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
0f56e32512 Object shorthand properties; small fixes to ES6 function parameters. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
50a82135c4 Recursive destructuring assignment with function arguments name clash checks. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
66e6bcd10f Assignable patterns. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
9b697af803 Destructuring assignments. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
f7fe322490 Better parentheses check for arrow expression argument list. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
1f801001cf ArrowExpression rest parameter support, brackets check and test fixes. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
5d50be1447 Removed dirty hack in favor of fixed expected locations for arrow and method functions (node's location should include arguments). 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
19696af666 Added computed properties support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
44a4f8c016 Added ES6 classes support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
eadda16c42 Added SpreadElement support.
testFail message fixes for object methods.
2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
67bca2d549 Added object method support. 2014-07-29 14:41:09 +02:00
Ingvar Stepanyan
a5cf393134 Fixed testFail messages for character escape sequences. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
2db14fbb08 Checking argument names clash in strict mode for arrow functions.
Some more testFail message fixes.
2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
16b9ba5db0 Fixed parsing x => 1, 2 like expressions. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
757545a612 Basic ES6 Arrow Expressions support.
Added Property type to ObjectExpression properties.
Reserved ES6 properties in Property type.
2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
12ac95732d Added ES6-specific Function properties. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
839338b270 Added octal and binary number support; added ES6 version checks. 2014-07-29 14:41:08 +02:00
Ingvar Stepanyan
a31bad6773 ES6 Unicode Code Point Escape Sequence support. 2014-07-29 14:41:08 +02:00
Johannes Herr
3d35d067a8 Removed some dead code in parseThrowStatement 2014-07-24 15:51:00 +02:00
Mathias Bynens
df9eda514a Add a script that generates the regular expressions for identifiers 2014-07-15 18:33:01 +02:00
Marijn Haverbeke
c1b2742ee7 Bump version number post 0.6 2014-06-06 22:42:22 +02:00
Marijn Haverbeke
4435013900 Mark version 0.6.0 2014-06-06 22:42:03 +02:00
impinball
29feccf3cd Split up parseStatement()
It was purely interpreted by the V8 engine. Splitting it up allows the
individual pieces to be optimized, so less is interpreted.
2014-06-06 12:40:32 +02:00
Marijn Haverbeke
55b507b715 Note partial es6 support in docs 2014-06-06 12:11:20 +02:00
Artem Govorov
1e5bfc2c55 ecma 6 partial support: let and const 2014-06-06 12:10:09 +02:00
Marijn Haverbeke
7f0f07e1f9 Check duplicate argument names for rest params
Issue #79
2014-05-28 23:24:10 +02:00
PlNG
dccd45528a Minor: Remove unused argument from readToken_slash
Possible dev relic.

readToken_slash currently does not have any arguments and does not appear to look at arguments. All existing tests pass after removal of extraneous argument while calling readToken_slash.
2014-05-28 22:27:41 +02:00
Brandon Mills
5552e866f9 Support rest parameters
http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters
The final parameter to a function is a rest parameter if it is
prefixed by "...". FunctionExpression and FunctionDeclaration
nodes have a new "rest" property that is null if there is no
rest parameter, or contains an Identifer for the parameter.
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API#Functions

Implemented by adding a new token, `_ellipsis`, which consists of
three dots. Modified the body of parseFunction to allow a single
rest parameter at the end of an argument list. Both the token and
the rest parameter require `options.ecmaVersion` >= 6, otherwise
three dots are tokenized as three dots.
2014-05-08 07:46:47 +02:00
Marijn Haverbeke
4869ccfa55 Prevent loose parser from tripping on invalid regexps
Issue #39
2014-03-25 17:45:58 +01:00
Marijn Haverbeke
e5439847fd Rename remaining *_t constructors to something sane 2014-03-25 17:29:17 +01:00
David Bonnet
7b9a46710d Renamed node_t to Node and exported it
This is to let programmers extend the Node object with utility methods
2014-03-25 17:23:30 +01:00
Marijn Haverbeke
e282ee4c01 Bump version number post-0.5 2014-03-12 17:32:17 +01:00
Marijn Haverbeke
a09455d2bf Mark version 0.5 2014-03-12 17:25:55 +01:00
Marijn Haverbeke
5bd50cce6f Don't complain about reserved words in property name position
Also add forbidReserved: "everywhere" support.

Issue #85
2014-02-14 11:27:48 +01:00
Marijn Haverbeke
716ade22fb Add allowReturnOutsideFunction option
Issue #86
2014-02-14 09:55:05 +01:00
Marijn Haverbeke
d55b6dee4a Update lastEnd in tokenizer interface
The hack for parsing --> depends on it.

Closes #84
2014-01-17 10:09:15 +01:00
Marijn Haverbeke
b1623b10c1 Note non-reentrancy of parser in onComment docs
Closes #80
2013-11-20 10:59:12 +01:00
Marijn Haverbeke
baaa16cee7 Make sure syntax errors in regular expressions raise conforming exceptions
Just letting the error from new RegExp through creates an exception missing the
pos/loc/raisedAt properties.

Issue #82
Issue #81
2013-11-20 10:56:28 +01:00
Marijn Haverbeke
dd456e3ad5 Fix bug causing comments after 'use strict' to be handled twice
Closes #76
2013-11-11 11:25:59 +01:00