mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Do not check typeof module.exports === 'object', since it will be the Base constructor function after straps.js is included.
Closes #461
This commit is contained in:
parent
5046a6a64c
commit
3389687c42
1 changed files with 4 additions and 2 deletions
|
@ -26,15 +26,17 @@ paper = new (PaperScope.inject(Base.exports, {
|
||||||
Key: Key
|
Key: Key
|
||||||
}))();
|
}))();
|
||||||
|
|
||||||
|
// https://github.com/umdjs/umd
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// Support AMD (e.g. require.js)
|
// Support AMD (e.g. require.js)
|
||||||
// Use named module AMD syntax since there are other unnamed calls to
|
// Use named module AMD syntax since there are other unnamed calls to
|
||||||
// define() inside the built library (from inlined Acorn / Esprima) that
|
// define() inside the built library (from inlined Acorn / Esprima) that
|
||||||
// apparently confuse the require.js optimizer.
|
// apparently confuse the require.js optimizer.
|
||||||
define('paper', paper);
|
define('paper', paper);
|
||||||
} else if (typeof module === 'object' && module // could be `null`
|
} else if (typeof module === 'object' && module) { // could be `null`
|
||||||
&& typeof module.exports === 'object') {
|
|
||||||
// Support CommonJS module
|
// Support CommonJS module
|
||||||
|
// NOTE: Do not check typeof module.exports === 'object' since it will be
|
||||||
|
// the Base constructor function after straps.js is included.
|
||||||
module.exports = paper;
|
module.exports = paper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue