Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Small change in generated script to avoid possible collision in windo…
Browse files Browse the repository at this point in the history
…w.default
  • Loading branch information
btd committed Jun 10, 2016
1 parent b9aaa27 commit 9962013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions browser-entry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import should from './es6/should';
import root from 'root';
import * as root from 'root';

var defaultProto = Object.prototype;
var defaultProperty = 'should';
Expand All @@ -12,14 +12,17 @@ try {
//ignore errors
}


if (typeof define === 'function' && define.amd) {
define([], function() { return should });
} else if (typeof module === 'object' && module.exports) {
module.exports = should;
} else {
root.Should = should;
var _root = root;

_root.Should = should;

Object.defineProperty(root, 'should', {
Object.defineProperty(_root, 'should', {
enumerable: false,
configurable: true,
value: should
Expand Down
9 changes: 5 additions & 4 deletions should.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
(function (root) {
'use strict';

root = 'default' in root ? root['default'] : root;

var types = {
NUMBER: 'number',
UNDEFINED: 'undefined',
Expand Down Expand Up @@ -3810,14 +3808,17 @@
//ignore errors
}


if (typeof define === 'function' && define.amd) {
define([], function() { return should });
} else if (typeof module === 'object' && module.exports) {
module.exports = should;
} else {
root.Should = should;
var _root = root;

_root.Should = should;

Object.defineProperty(root, 'should', {
Object.defineProperty(_root, 'should', {
enumerable: false,
configurable: true,
value: should
Expand Down

0 comments on commit 9962013

Please sign in to comment.