90 Commits

Author SHA1 Message Date
Sebastian McKenzie
9f435d02f2 switch to a custom list of global keys and use object helper 2015-01-23 23:04:33 +11:00
Sebastian McKenzie
9bfe6e7aac add Scope::getFunctionParent method 2015-01-22 17:20:29 +11:00
Sebastian McKenzie
3e2d611707 store all undeclared references on Program to better handle let scoping 2015-01-22 10:12:03 +11:00
Sebastian McKenzie
870954c6be rewrite constants transformer 2015-01-22 07:37:18 +11:00
Sebastian McKenzie
c2d61ad660 more intelligent scope tracking and insertion 2015-01-22 01:40:26 +11:00
Sebastian McKenzie
ccdb480d44 rename traverser to visitor 2015-01-22 00:28:20 +11:00
Sebastian McKenzie
ac373a9e1c use scope for uid registry instead of a global registry 2015-01-22 00:27:45 +11:00
Sebastian McKenzie
287bfc77b2 add scope file.generateUidIdentifier alias 2015-01-21 23:58:43 +11:00
Sebastian McKenzie
3205c78f01 ensure that a scope is always passed to traverse and allow scopes to have access to file 2015-01-21 23:52:12 +11:00
Dan Abramov
3d9d842a0d Extract traversers outside methods 2015-01-21 14:34:47 +03:00
Sebastian McKenzie
193a3c167e loops should contain their child block let declarations 2015-01-20 19:33:26 +11:00
Sebastian McKenzie
26cb5d5a65 add block to for loop scope - fixes #538 2015-01-20 16:48:41 +11:00
Sebastian McKenzie
36a933a004 add strict mode to every file 2015-01-18 18:44:08 +11:00
Sebastian McKenzie
309d19960f better traversal context variable names 2015-01-18 18:23:46 +11:00
Sebastian McKenzie
774cb66d9b add isBlockedScoped types helper 2015-01-18 18:23:37 +11:00
Sebastian McKenzie
d0dc972840 fix up formatting in traverse 2015-01-18 02:35:19 +11:00
Sebastian McKenzie
621e66e9ac add private declaration and comprehension expression support to scope tracking and id building 2015-01-18 02:35:08 +11:00
Dan Abramov
f9480b5280 Avoid closures when traversing 2015-01-17 00:13:39 +03:00
Dan Abramov
8dc4996547 Refactor traversal into smaller methods 2015-01-17 00:13:39 +03:00
Dan Abramov
4f01f67dd6 Avoid delete in favor of null assignment to prevent deoptimizations 2015-01-17 00:13:39 +03:00
Sebastian McKenzie
f6c72e9ae9 add newline to scope 2015-01-11 22:15:56 +11:00
Sebastian McKenzie
75e97d9f7e format scope default declarations better 2015-01-10 22:34:08 +11:00
Sebastian McKenzie
1985146760 use Array.isArray instead of _.isArray 2015-01-10 22:26:37 +11:00
Dan Abramov
421906bcc1 Refactor traversal to avoid closures 2015-01-10 14:02:08 +03:00
Dan Abramov
1231dc6cef Replace _.each and for-in with for loop in hot paths 2015-01-09 16:00:53 +03:00
Sebastian McKenzie
7f4efecb7d support for CallExpression in Scope.prototype.generateUidBasedOnNode 2015-01-04 07:59:43 +11:00
Sebastian McKenzie
d945379b5b remove isDynamic checks and always execute those expressions **once** 2015-01-03 21:48:06 +11:00
Sebastian McKenzie
d20ab0eb05 rename traverse stop method to skip and add a stop method that actually breaks the current traversal 2015-01-03 20:08:31 +11:00
Sebastian McKenzie
f1a178f8f9 compact body nodes in traversal 2015-01-02 01:59:49 +11:00
Sebastian McKenzie
07667d80ff clean up traverse 2015-01-01 22:34:05 +11:00
Sebastian McKenzie
9a633ebd9c update scope to use new traversal api 2015-01-01 22:33:40 +11:00
Sebastian McKenzie
03efd69998 check if node exists before inheriting comments to it 2014-12-29 01:37:12 +11:00
Sebastian McKenzie
d951082b09 move replacement node comment inheritance to traverse replacement 2014-12-29 01:26:11 +11:00
Sebastian McKenzie
6df6652629 better circular references in amd/umd/system module formatter 2014-12-28 09:35:47 +11:00
Sebastian McKenzie
601bbb86cd remap UpdateExpression in module exports - closes #334 2014-12-28 01:00:53 +11:00
Sebastian McKenzie
e96d02c972 make traversal code simpler 2014-12-27 17:01:47 +11:00
Sebastian McKenzie
4ea425ac7b remove ParenthesizedExpression 2014-12-22 21:36:33 +11:00
Sebastian McKenzie
fc7fc384c9 add declaration/reference support to scope 2014-12-16 08:06:56 +11:00
Sebastian McKenzie
c7d69b2f92 block scope constants 2014-12-10 23:49:13 +11:00
Sebastian McKenzie
dae46bfbfa DRY up isDynamic checks - add isDynamic check to spread - fixes #232 2014-12-05 10:53:46 +11:00
Sebastian McKenzie
a0219ef278 fix let scoping unneccesary override - fixes #245 2014-12-05 09:55:26 +11:00
Sebastian McKenzie
758a873894 avoid ensuring a block on non-array node replacements 2014-11-30 23:39:08 +11:00
Sebastian McKenzie
5f21fc2f17 ensureBlock on multiple node replacements - fixes #229 2014-11-30 11:10:57 +11:00
Sebastian McKenzie
d184bc93b9 add playground 2014-11-25 23:50:50 +11:00
Sebastian McKenzie
07de6f5f4a clean up Scope reference addition 2014-11-25 18:59:45 +11:00
Sebastian McKenzie
b8ec87e058 fix Scope::push block type error message 2014-11-24 00:59:56 +11:00
Sebastian McKenzie
49e7e3b998 fix multiple references in experimental abstract references #207 2014-11-24 00:35:18 +11:00
Sebastian McKenzie
b5feaf7c2f remove dead code 2014-11-20 21:17:57 +11:00
Sebastian McKenzie
a90f133918 update Scope arguments 2014-11-20 21:09:38 +11:00
Sebastian McKenzie
0a25618c34 collect references that haven't been declared in scope - fixes #173 and fixes #175 2014-11-20 16:53:22 +11:00