mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Fix exporting of Base, Numerical and PaperScript into PaperScope.
This commit is contained in:
parent
5149b23065
commit
a81fdc2758
2 changed files with 6 additions and 4 deletions
|
@ -81,8 +81,7 @@ Base.inject(/** @lends Base# */{
|
|||
statics: /** @lends Base */{
|
||||
|
||||
// Keep track of all named classes for serialization and exporting.
|
||||
// Also register the Base class itself.
|
||||
exports: new Base({ Base: Base }),
|
||||
exports: new Base(),
|
||||
|
||||
extend: function extend(src) {
|
||||
// Override Base.extend() to register named classes in Base.exports,
|
||||
|
|
|
@ -10,9 +10,12 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
// Add PaperScript and Numerical to exports, inject all exports into PaperScope,
|
||||
// and create the initial paper object, all in one condensed statement:
|
||||
// First add Base, PaperScript and Numerical to exports, then inject all exports
|
||||
// into PaperScope, and create the initial paper object, all in one statement:
|
||||
paper = new (PaperScope.inject(Base.exports.inject({
|
||||
// Mark fields as enumeralbe so PaperScope.inject can pick them up
|
||||
enumerable: true,
|
||||
Base: Base,
|
||||
PaperScript: PaperScript,
|
||||
Numerical: Numerical
|
||||
})))();
|
||||
|
|
Loading…
Reference in a new issue