[Pkg-javascript-commits] [node-umd] 06/11: Get rid of SES and Montage bootstrap.

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


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

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

commit f5fd0e6cfd83bc954334e6c08f899a9b67dff563
Author: Domenic Denicola <domenic at domenicdenicola.com>
Date:   Mon Jul 29 00:21:24 2013 -0400

    Get rid of SES and Montage bootstrap.
    
    As per kriskowal/q#317 discussions.
---
 examples/cjs/bundle.js         |  2 +-
 examples/constructor/bundle.js |  2 +-
 examples/raw/bundle.js         |  2 +-
 index.js                       |  4 ++--
 template.js                    | 16 ++--------------
 5 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/examples/cjs/bundle.js b/examples/cjs/bundle.js
index 4ceada7..3874f6d 100644
--- a/examples/cjs/bundle.js
+++ b/examples/cjs/bundle.js
@@ -1,3 +1,3 @@
-(function(e){if("function"==typeof bootstrap)bootstrap("common-js-module",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCommonJsModule=e}else"undefined"!=typeof window?window.commonJsModule=e():global.commonJsModule=e()})(function(){var define,ses,bootstrap,module,exports;module={exports:(exports={})};
+!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.commonJsModule=e():"undefined"!=typeof global?global.commonJsModule=e():"undefined"!=typeof self&&(self.commonJsModule=e())}(function(){var define,module,exports;module={exports:(exports={})};
 module.exports = "common JS example";
 return module.exports;});
\ No newline at end of file
diff --git a/examples/constructor/bundle.js b/examples/constructor/bundle.js
index 6212ca0..7eb6329 100644
--- a/examples/constructor/bundle.js
+++ b/examples/constructor/bundle.js
@@ -1,3 +1,3 @@
-(function(e){if("function"==typeof bootstrap)bootstrap("common-js-module",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCommonJsModule=e}else"undefined"!=typeof window?window.CommonJsModule=e():global.CommonJsModule=e()})(function(){var define,ses,bootstrap,module,exports;
+!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.CommonJsModule=e():"undefined"!=typeof global?global.CommonJsModule=e():"undefined"!=typeof self&&(self.CommonJsModule=e())}(function(){var define,module,exports;
 return "Constructor example";
 });
\ No newline at end of file
diff --git a/examples/raw/bundle.js b/examples/raw/bundle.js
index cc2afd9..a967d63 100644
--- a/examples/raw/bundle.js
+++ b/examples/raw/bundle.js
@@ -1,3 +1,3 @@
-(function(e){if("function"==typeof bootstrap)bootstrap("common-js-module",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCommonJsModule=e}else"undefined"!=typeof window?window.commonJsModule=e():global.commonJsModule=e()})(function(){var define,ses,bootstrap,module,exports;
+!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.commonJsModule=e():"undefined"!=typeof global?global.commonJsModule=e():"undefined"!=typeof self&&(self.commonJsModule=e())}(function(){var define,module,exports;
 return "Raw example";
 });
\ No newline at end of file
diff --git a/index.js b/index.js
index 05564db..3badff0 100644
--- a/index.js
+++ b/index.js
@@ -12,7 +12,7 @@ function template(moduleName, cjs) {
     .split('source()')
   str[0] = str[0].trim();
   //make sure these are undefined so as to not get confused if modules have inner UMD systems
-  str[0] += 'var define,ses,bootstrap,module,exports;';
+  str[0] += 'var define,module,exports;';
   if (cjs) str[0] += 'module={exports:(exports={})};';
   str[0] += '\n';
   if (cjs) str[1] = 'return module.exports;' + str[1];
@@ -60,4 +60,4 @@ function pascalCase(name) {
 function camelCase(name) {
   name = name.replace(/\-([a-z])/g, function (_, char) { return char.toUpperCase(); });
   return name.replace(/[^a-zA-Z0-9]+/g, '');
-}
\ No newline at end of file
+}
diff --git a/template.js b/template.js
index d45f971..f040973 100644
--- a/template.js
+++ b/template.js
@@ -1,24 +1,12 @@
 ;(function (f) {
-  // Montage Require
-  if (typeof bootstrap === "function") {
-    bootstrap("{{name}}", f);
-
   // CommonJS
-  } else if (typeof exports === "object") {
+  if (typeof exports === "object") {
     module.exports = f();
 
   // RequireJS
   } else if (typeof define === "function" && define.amd) {
     define(f);
 
-  // SES (Secure EcmaScript)
-  } else if (typeof ses !== "undefined") {
-    if (!ses.ok()) {
-      return;
-    } else {
-      ses.make{{pascalcase}} = f;
-    }
-
   // <script>
   } else {
     if (typeof window !== "undefined") {
@@ -32,4 +20,4 @@
 
 })(function () {
   source()//trick uglify-js into not minifying
-});
\ No newline at end of file
+});

-- 
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