Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert all esprima.parse calls to go through an adapter so xpconnect…
… can use native parser for all ops
- Loading branch information
Showing
9 changed files
with
168 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @license Copyright (c) 2012, The Dojo Foundation All Rights Reserved. | ||
* Available via the MIT or new BSD license. | ||
* see: http://github.com/jrburke/requirejs for details | ||
*/ | ||
|
||
/*global define, Reflect */ | ||
|
||
/* | ||
* xpcshell has a smaller stack on linux and windows (1MB vs 9MB on mac), | ||
* and the recursive nature of esprima can cause it to overflow pretty | ||
* quickly. So favor it built in Reflect parser: | ||
* https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API | ||
*/ | ||
define(['./esprima', 'env'], function (esprima, env) { | ||
if (env.get() === 'xpconnect' && typeof Reflect !== 'undefined') { | ||
return Reflect; | ||
} else { | ||
return esprima; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.