Fix exporting of Base, Numerical and PaperScript into PaperScope.

This commit is contained in:
Jürg Lehni 2013-05-30 14:37:04 -07:00
parent 5149b23065
commit a81fdc2758
2 changed files with 6 additions and 4 deletions

View file

@ -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,

View file

@ -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
})))();