Browse Source

Fix nodejs warning

"[DEP0016] DeprecationWarning: 'GLOBAL' is deprecated, use 'global'"
Vladislav Folts 4 năm trước cách đây
mục cha
commit
de6ce9e1c3
3 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 1 1
      browser/linkjs.py
  2. 1 1
      src/nodejs.js
  3. 1 1
      src/rtl.js

+ 1 - 1
browser/linkjs.py

@@ -58,7 +58,7 @@ def link(input_paths, output_path, dirs, version = None):
 		prolog = ""
 		if not version is None:
 			prolog += 'var buildVersion = %s;\n' % encode_to_js_string(version)
-		prolog += "var GLOBAL = this;\n"
+		prolog += "var global = this;\n"
 		prolog += "var imports = {};\n"
 		prolog += 'function require(module){return imports[module];}\n'
 		out.write(prolog)

+ 1 - 1
src/nodejs.js

@@ -26,7 +26,7 @@ var ModuleGenerator = Class.extend({
             var importName = this.__importDir ? this.__importDir + "/" + name
                                               : name;
             result += "var " + CodeGenerator.mangleId(alias) + " = " + (name == "JS" 
-                ? "GLOBAL"
+                ? "global"
                 : "require(\"" + importName + ".js\")") + ";\n";
         }
         return result;

+ 1 - 1
src/rtl.js

@@ -1,7 +1,7 @@
 "use strict";
 
 if (typeof Uint16Array == "undefined"){
-    GLOBAL.Uint16Array = function(length){
+    global.Uint16Array = function(length){
         Array.call(this, length);
         for(var i = 0; i < length; ++i)
             this[i] = 0;