[Pkg-javascript-commits] [node-umd] 04/10: Add `this` as a fallback global for Java 8 Nashorn

Bastien Roucariès rouca at moszumanska.debian.org
Mon Apr 17 07:38:13 UTC 2017


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

rouca pushed a commit to annotated tag 3.0.0
in repository node-umd.

commit a83fe8d4b43bf687d398074fc43c90f3e87bd460
Author: Forbes Lindesay <forbes at lindesay.co.uk>
Date:   Wed Feb 4 13:22:51 2015 +0000

    Add `this` as a fallback global for Java 8 Nashorn
    
    [closes #22]
---
 template.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/template.js b/template.js
index 876b46f..24833e7 100644
--- a/template.js
+++ b/template.js
@@ -16,6 +16,11 @@
       g = global;
     } else if (typeof self !== "undefined") {
       g = self;
+    } else {
+      // works providing we're not in "use strict";
+      // needed for Java 8 Nashorn
+      // seee https://github.com/facebook/react/issues/3037
+      g = this;
     }
     {{defineNamespace}};
   }

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



More information about the Pkg-javascript-commits mailing list