mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-07 10:14:02 -04:00
Export classes through PaperScope in dev mode too.
This commit is contained in:
parent
c6cf4f9cf0
commit
5b963b13e1
1 changed files with 10 additions and 4 deletions
|
@ -19,13 +19,19 @@
|
||||||
// that allow us to use their names.
|
// that allow us to use their names.
|
||||||
// Setting Function#name is not possible, as that is read-only.
|
// Setting Function#name is not possible, as that is read-only.
|
||||||
Base.each(this, function(val, key) {
|
Base.each(this, function(val, key) {
|
||||||
if (val && val.prototype instanceof Base)
|
if (val && val.prototype instanceof Base) {
|
||||||
val._name = key;
|
val._name = key;
|
||||||
|
/*#*/ if (options.version == 'dev') {
|
||||||
|
// If we're in dev mode, also export all classes through PaperScope, to
|
||||||
|
// mimick scoping behavior of the built library.
|
||||||
|
PaperScope.prototype[key] = val;
|
||||||
|
/*#*/ } // options.version == 'dev'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*#*/ if (options.version == 'dev') {
|
/*#*/ if (options.version == 'dev') {
|
||||||
// We're already leaking into the global scope, so let's just assign the global
|
// See paper.js for the non-dev version of this code. We cannot handle dev there
|
||||||
// paper object with a prepare scope. See paper.js for the non-dev version of
|
// due to the seperate loading of all source files, which are only availabe
|
||||||
// this code.
|
// after the execution of paper.js
|
||||||
paper = new PaperScope();
|
paper = new PaperScope();
|
||||||
/*#*/ } // options.version == 'dev'
|
/*#*/ } // options.version == 'dev'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue