From e7ac0ccb923bc6f5b61768960f568515f4d92ce3 Mon Sep 17 00:00:00 2001 From: guybedford Date: Sun, 9 Aug 2015 11:58:32 +0200 Subject: [PATCH] ie test fixes --- lib/core.js | 2 +- lib/meta.js | 2 +- test/test.js | 10 ++++++---- test/tests/cs-loader.js | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/core.js b/lib/core.js index 2d6144576..5b686ba12 100644 --- a/lib/core.js +++ b/lib/core.js @@ -188,7 +188,7 @@ SystemJSLoader.prototype.config = function(cfg) { this.packages[prop]= this.packages[prop] || {}; for (var q in cfg.packages[p]) { - if (packageProperties.indexOf(q) == -1 && typeof console != 'undefined' && console.warn) + if (indexOf.call(packageProperties, q) == -1 && typeof console != 'undefined' && console.warn) console.warn('"' + q + '" is not a valid package configuration option in package ' + p); this.packages[prop][q] = cfg.packages[p][q]; } diff --git a/lib/meta.js b/lib/meta.js index 82b1e97b6..80e6f08be 100644 --- a/lib/meta.js +++ b/lib/meta.js @@ -62,7 +62,7 @@ var bestDepth = 0; var wildcardIndex; for (var module in meta) { - wildcardIndex = indexOf.call(module, '*'); + wildcardIndex = module.indexOf('*'); if (wildcardIndex === -1) continue; if (module.substr(0, wildcardIndex) === name.substr(0, wildcardIndex) diff --git a/test/test.js b/test/test.js index 97c8588f4..8b254eaee 100644 --- a/test/test.js +++ b/test/test.js @@ -558,9 +558,7 @@ asyncTest('Loading dynamic modules with __esModule flag set', function() { }, err); }); -if (ie8) - return; - +if (!ie8) { asyncTest('ES6 named export loading of CJS', function() { System['import']('tests/es-named-import-cjs.js').then(function(m) { ok(m.cjsFuncValue === 'named export'); @@ -779,6 +777,7 @@ asyncTest('Loading two bundles that have a shared dependency', function() { }, err); }, err); }); +} asyncTest("System clone", function() { var clonedSystem = new System.constructor(); @@ -821,7 +820,7 @@ asyncTest("Duplicate entries", function() { }); // new features!! - +if (!ie8) asyncTest('Named imports for non-es6', function() { System['import']('tests/es6-cjs-named-export.js').then(function(m) { ok(m.someExport == 'asdf'); @@ -854,6 +853,7 @@ asyncTest('Multi-format deps meta', function() { }, err); }); + asyncTest('Wildcard meta', function() { System.config({ meta: { @@ -914,6 +914,7 @@ asyncTest('Package configuration CommonJS config example', function() { }, err); }); +if (!ie8) asyncTest('Conditional loading', function() { System.set('env', System.newModule({ 'browser': 'ie' })); @@ -932,6 +933,7 @@ asyncTest('Boolean conditional false', function() { }, err); }); +if (!ie8) asyncTest('Boolean conditional true', function() { System.set('env', System.newModule({ 'js': { 'es5': true } })); diff --git a/test/tests/cs-loader.js b/test/tests/cs-loader.js index 15fd53fe0..cc24b3fe9 100644 --- a/test/tests/cs-loader.js +++ b/test/tests/cs-loader.js @@ -1,3 +1,3 @@ -export function translate(load) { +exports.translate = function translate(load) { return load.source.replace(/#/g, ''); } \ No newline at end of file