[Pkg-javascript-commits] [node-acorn-jsx] 137/484: Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit 097b4162dab6e0be89bd92a152cd8946685baf36
Author: Jürg Lehni <juerg at scratchdisk.com>
Date:   Wed Jul 17 16:23:17 2013 -0700

    Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js
    
    Use same approach as Esprima.
---
 acorn.js       | 6 +++---
 acorn_loose.js | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/acorn.js b/acorn.js
index 43db6e9..9808f43 100644
--- a/acorn.js
+++ b/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";
diff --git a/acorn_loose.js b/acorn_loose.js
index 105fe7d..cf73345 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list