diff --git a/src/scripts/require.js b/src/scripts/require.js index 24c6a16c9..5656bfa82 100644 --- a/src/scripts/require.js +++ b/src/scripts/require.js @@ -67,7 +67,7 @@ var define; }; define = function (id, factory) { - if (modules[id]) { + if (Object.prototype.hasOwnProperty.call(modules, id)) { throw 'module ' + id + ' already defined'; } diff --git a/test/test.require.js b/test/test.require.js index b66e9abde..ace76169c 100644 --- a/test/test.require.js +++ b/test/test.require.js @@ -231,7 +231,7 @@ describe('require + define', function () { }); // Adapted version of CommonJS test `hasOwnProperty` - xit('Test#018 : allows properties of Object.prototype as module names', () => { + it('Test#018 : allows properties of Object.prototype as module names', () => { expect(() => { define('hasOwnProperty', jasmine.createSpy()); }).not.toThrow();