114 Commits

Author SHA1 Message Date
Sebastian McKenzie
39e0b51d17 Merge branch 'check-lval-paren-expressions' of https://github.com/sebmck/acorn 2014-11-09 13:07:41 +11:00
Sebastian McKenzie
521ab6c11d Support ParanthesizedExpressions in checkLval 2014-11-09 13:07:00 +11:00
Sebastian McKenzie
f82896a919 Merge branch 'computed-static-mutator-class-methods' of https://github.com/sebmck/acorn 2014-11-04 11:41:49 +11:00
Sebastian McKenzie
4f0c37eb68 Add support for computed static mutator class methods 2014-11-04 11:40:49 +11:00
Sebastian McKenzie
fb0fb90911 Merge branch 'fix-semicolons-modules' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-10-29 21:02:26 +11:00
Marijn Haverbeke
8a799c6077 Remove redundant range info from tests 2014-10-27 10:59:16 +01:00
Ingvar Stepanyan
f26b656ea5 Remove property name clash check in ES6 as per Draft Rev 26.
See https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-6.md#conclusionresolution-3 for details.

Conflicts:
	test/tests-harmony.js
2014-10-27 10:56:06 +01:00
Sebastian McKenzie
f48503cd31 add unicode flag support to regex 2014-10-27 10:51:23 +01:00
Ingvar Stepanyan
fd79ac5879 Move comprehension support under ecmaVersion: 7 as per spec. 2014-10-27 10:34:53 +01:00
Sebastian McKenzie
0cc9322bca Merge branch 'add-unicode-regex-support' of https://github.com/sebmck/acorn
Conflicts:
	acorn.js
2014-10-25 12:52:21 +11:00
Sebastian McKenzie
6eeb101185 add regex tests 2014-10-25 09:02:34 +11:00
Sebastian McKenzie
7a4715c2de Merge branch 'master' of https://github.com/marijnh/acorn
Conflicts:
	acorn.js
	package.json
2014-10-22 21:30:58 +11:00
Max Schaefer
d525c45644 Add option for representing parenthesized expressions in the AST. 2014-10-13 12:19:39 +02:00
Max Schaefer
e9c7209f8b Guard against missing elements in array patterns when checking function parameters. 2014-10-13 12:17:29 +02:00
Marijn Haverbeke
3603f7d0b1 Adjust start positions of parenthesized expressions to not include parentheses
Issue #136
2014-10-08 11:52:49 +02:00
r-e-d
f3e759cd03 Strict mode incorrectly reset after function 2014-09-30 11:45:20 +02:00
Max Schaefer
015a0e90bc Only accept for-of loops in ECMA6 mode. 2014-09-29 11:27:14 +02:00
Ingvar Stepanyan
daedc6fcb3 Fixes #129 and spaces in template quasi literals.
* Added hack to correctly handle skipped spaces after= template expressions.
* Added `null` default values for regular functions.
* Added regression tests for both.
2014-09-26 17:04:22 +02:00
Arthur Stolyar
78a6caf673 Add test for inXJSChild MemberExpression 2014-09-09 02:12:39 +03:00
Ingvar Stepanyan
3086621905 Merge branch 'master' into jsx. 2014-09-08 23:58:19 +03:00
Ingvar Stepanyan
10553cbced Make token format compatible with Esprima and Mozilla-styled locations.
* Tokens are now instances of single exported constructor Token.
* Token objects are compatible with Esprima (only `type` format is different).
* Added token.loc in format of node.loc (Mozilla).
* Deprecated token.startLoc & token.endLoc.
* Updated comment generation example.

Also added ability to pass arrays in `onToken`/`onComment` where
tokens/comments will be collected in Esprima's format so you can
simply pass those arrays to `escodegen.attachComments`.

Updated docs and comment attachment example.
2014-09-08 12:20:08 +02:00
Ingvar Stepanyan
35c8f104bd Spread attribute support and small optimizations.
Conflicts:
	acorn.js
	docs/acorn.html
	package.json
	test/tests.js
2014-09-05 17:01:42 +03:00
Max Schaefer
a246bf83d0 Do not throw syntax error if strict mode function has same name as one of its parameters. 2014-09-05 15:59:57 +02:00
Ingvar Stepanyan
fe6cafa141 Upgrade esprima to esprima-fb and update docs.
Conflicts:
	test/compare/esprima.js
2014-09-05 16:54:56 +03:00
Ingvar Stepanyan
817120b370 Small test refactoring. 2014-09-05 16:54:29 +03:00
Max Schaefer
7da3b6f1fd Fix start position for HTML comments and add tests. 2014-09-05 15:53:36 +02:00
Ingvar Stepanyan
f53f89a0ae Fixed test with parenthesis. 2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
5d2ace2f58 Added JSX text and string literal parsing. 2014-09-05 16:43:17 +03:00
Ingvar Stepanyan
b4c5d1f2e9 Added support for namespaces and member expressions in tag names. 2014-09-05 16:42:29 +03:00
Ingvar Stepanyan
283d47c038 Started porting JSX support from esprima-fb.
Conflicts:
	acorn.js
	test/tests.js
2014-09-05 16:42:29 +03:00
Ingvar Stepanyan
1bf8c1420f Added example for comments attachment.
* Fixed `onToken` & `tokenize` to return `startLoc` & `endLoc`
in token object only when `options.locations` is `true`.
* Fixed `onToken` tests.
* Added example for generating comments with escodegen.
2014-07-31 14:01:39 +03:00
Ingvar Stepanyan
be11e04383 Added onToken support. 2014-07-31 14:01:39 +03:00
Marijn Haverbeke
aac1807838 Include Harmony tests in test/index.html 2014-07-29 14:43:20 +02:00
Ingvar Stepanyan
ff9c3550a4 Allow computed class method names (as per ariya/esprima#271). 2014-07-29 14:41:49 +02:00
Ingvar Stepanyan
acbef8557f Treat line ending after yield keyword as end of YieldExpression
(as per http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-function-definitions-runtime-semantics-evaluation).
2014-07-29 14:41:45 +02:00
Ingvar Stepanyan
9d552efe45 Added Generator Comprehension support. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
1c548e7848 Add missing Traceur source to repo. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
e9635f450e Delete harmonytest.js 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
afefac56bf Added test to represent "import x, { ... } from 'module'" case. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
9d5e0e7973 Increased benchmark time to 5 seconds per parser to get more realistic numbers. 2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
8b19246615 Replaced UglifyJS2 with Traceur for fair comparison of ES6-enabled parsers. 2014-07-29 14:41:38 +02:00
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
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
a8cf37fc46 Test fixes for imports. 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
f2dfeff977 Added test for BindingPattern inside ArrayComprehension
(fails in esprima - https://code.google.com/p/esprima/issues/detail?id=570).
2014-07-29 14:41:18 +02:00