Socket
Socket
Sign inDemoInstall

intern-systemjs-loader

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intern-systemjs-loader - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

html-report/base.css

82

main.js

@@ -1,8 +0,9 @@

(function () {
(function (global) {
var realRequire, realDefine,
nodeRequire = require,
slice = Array.prototype.slice,
internBase = '/node_modules/intern',
thisBase = '/node_modules/intern-systemjs-loader',
polyfillUrl = '/node_modules/systemjs/dist/system-polyfills.js',
systemJSUrl = '/node_modules/systemjs/dist/system.src.js',
internBase = 'node_modules/intern',
thisBase = 'node_modules/intern-systemjs-loader',
polyfillUrl = 'node_modules/systemjs/dist/system-polyfills.js',
systemJSUrl = 'node_modules/systemjs/dist/system.src.js',
requireQueue = [],

@@ -13,3 +14,3 @@ defineQueue = [],

pluginFirst: true,
baseURL: '/',
baseURL: nodeRequire ? '' : '/',
meta: {

@@ -34,4 +35,4 @@ 'intern/*': { scriptLoad: true },

hasMap = {
'host-browser': true,
'host-node': false
'host-browser': !nodeRequire,
'host-node': !!nodeRequire
};

@@ -51,6 +52,10 @@

SystemJS.set('@intern-systemjs-loader:undefined', System.newModule({ __useDefault: true }));
SystemJS.set('@intern-systemjs-loader:node', System.newModule({
fetch: function () { return ''; },
instantiate: function (load) { return nodeRequire(load.address); }
}));
// Normalize "dojo/has" to either our hasPlugin or hasModule GUIDs depending on whether it's
// required as a loader plugin or a module.
SystemJS.normalize = function (name, parentName, parentAddress) {
SystemJS.normalize = function normalizeForIntern (name, parentName, parentAddress) {
var current, split, target,

@@ -87,3 +92,4 @@ // Matcher for `dojo/has!foo?bar:baz`, where bar or baz could also be a ternary condition

return target ? normalize.call(this, target) : '@intern-systemjs-loader:undefined';
// Run the result through this normalizer again if required
return target ? normalizeForIntern.call(this, target) : '@intern-systemjs-loader:undefined';
}

@@ -98,2 +104,7 @@

// dojo/node!x can be normalized to @node/x
if (name.indexOf('dojo/node!') === 0) {
return '@intern-systemjs-loader:node!' + name.split('!')[1];
}
return normalize.call(this, name, parentName, parentAddress);

@@ -105,20 +116,3 @@ };

function loadSystemJS() {
loadScript(systemJSUrl, function () {
window.require = realRequire = System.amdRequire;
window.define = realDefine = System.amdDefine;
require.config = System.config.bind(System);
setHooks();
// Flush any queues that were populated before SystemJS finished loading
while (configQueue.length) {
System.config.apply(System, configQueue.shift());
}
while (defineQueue.length) {
realDefine.apply(null, defineQueue.shift());
}
while (requireQueue.length) {
realRequire.apply(null, requireQueue.shift());
}
});
loadScript(systemJSUrl, swapLoader);
}

@@ -135,5 +129,25 @@

function swapLoader() {
global.require = realRequire = System.amdRequire;
global.define = realDefine = System.amdDefine;
realRequire.config = System.config.bind(System);
realRequire.nodeRequire = nodeRequire;
setHooks();
// Flush any queues that were populated before SystemJS finished loading
while (configQueue.length) {
System.config.apply(System, configQueue.shift());
}
while (defineQueue.length) {
realDefine.apply(null, defineQueue.shift());
}
while (requireQueue.length) {
realRequire.apply(null, requireQueue.shift());
}
}
// Provide the initial define, require and config functions. These just push the arguments to
// arrays so they can be recalled when SystemJS has finished loading.
window.define = function () {
global.define = function () {
if (realDefine) {

@@ -147,3 +161,3 @@ realDefine.apply(null, arguments);

window.require = function () {
global.require = function () {
if (realRequire) {

@@ -161,4 +175,8 @@ realRequire.apply(null, arguments);

if (nodeRequire) {
global.SystemJS = global.System = nodeRequire('systemjs');
swapLoader();
}
// Load when.js first if Promise is unavailable
if (typeof Promise === 'undefined') {
else if (typeof Promise === 'undefined') {
loadScript(polyfillUrl, loadSystemJS);

@@ -169,2 +187,2 @@ }

}
})();
})(typeof global !== 'undefined' ? global : window);
{
"name": "intern-systemjs-loader",
"version": "0.0.4",
"version": "0.1.0",
"description": "A wrapper for using SystemJS as Intern's loader",

@@ -8,3 +8,4 @@ "main": "index.js",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "phantomjs --remote-debugger-port=9001 --webdriver=4444 & ./node_modules/.bin/intern-runner config=tests/local.intern",
"testClient": "./node_modules/.bin/intern-client config=tests/local.intern"
},

@@ -22,3 +23,7 @@ "keywords": [

"systemjs": "^0.19.27"
},
"devDependencies": {
"intern": "^3.2.0",
"systemjs-plugin-babel": "0.0.10"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc