Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js
Use same approach as Esprima.
This commit is contained in:
committed by
Marijn Haverbeke
parent
a84e21e0ff
commit
097b4162da
6
acorn.js
6
acorn.js
@@ -20,11 +20,11 @@
|
||||
// [dammit]: acorn_loose.js
|
||||
// [walk]: util/walk.js
|
||||
|
||||
(function(mod) {
|
||||
(function(root, mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS
|
||||
if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD
|
||||
mod(this.acorn || (this.acorn = {})); // Plain browser env
|
||||
})(function(exports) {
|
||||
mod(root.acorn || (root.acorn = {})); // Plain browser env
|
||||
})(this, function(exports) {
|
||||
"use strict";
|
||||
|
||||
exports.version = "0.3.2";
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
// invasive changes and simplifications without creating a complicated
|
||||
// tangle.
|
||||
|
||||
(function(mod) {
|
||||
(function(root, mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") return mod(exports, require("./acorn")); // CommonJS
|
||||
if (typeof define == "function" && define.amd) return define(["exports", "./acorn"], mod); // AMD
|
||||
mod(this.acorn || (this.acorn = {}), this.acorn); // Plain browser env
|
||||
})(function(exports, acorn) {
|
||||
mod(root.acorn || (root.acorn = {}), root.acorn); // Plain browser env
|
||||
})(this, function(exports, acorn) {
|
||||
"use strict";
|
||||
|
||||
var tt = acorn.tokTypes;
|
||||
|
||||
Reference in New Issue
Block a user