mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Handle exporting of Numerical and PaperScript in export.js
Allowing build.sh to work again.
This commit is contained in:
parent
099a5546cb
commit
961451b271
5 changed files with 13 additions and 11 deletions
|
@ -82,7 +82,7 @@ Base.inject(/** @lends Base# */{
|
|||
|
||||
// Keep track of all named classes for serialization and exporting.
|
||||
// Also register the Base class itself.
|
||||
exports: { 'Base': Base },
|
||||
exports: new Base({ Base: Base }),
|
||||
|
||||
extend: function extend(src) {
|
||||
// Override Base.extend() to register named classes in Base.exports,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/*#*/ include('../../lib/esprima-min.js');
|
||||
/*#*/ }
|
||||
|
||||
var PaperScript = Base.exports.PaperScript = new function() {
|
||||
var PaperScript = new function() {
|
||||
// Operators to overload
|
||||
|
||||
var binaryOperators = {
|
||||
|
|
|
@ -10,5 +10,9 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
// Export all named classes to PaperScope and create the initial paper object.
|
||||
var paper = new (PaperScope.inject(Base.exports))();
|
||||
// Add PaperScript and Numerical to exports, inject all exports into PaperScope,
|
||||
// and create the initial paper object, all in one condensed statement:
|
||||
var paper = new (PaperScope.inject(Base.exports.inject({
|
||||
PaperScript: PaperScript,
|
||||
Numerical: Numerical
|
||||
})))();
|
||||
|
|
10
src/paper.js
10
src/paper.js
|
@ -39,17 +39,15 @@ var paper = new function() {
|
|||
/*#*/ include('../lib/stats.js');
|
||||
/*#*/ } // options.stats
|
||||
|
||||
/*#*/ if (options.version == 'dev') {
|
||||
/*#*/ include('constants.js');
|
||||
/*#*/ } // options.version == 'dev'
|
||||
|
||||
/*#*/ include('core/Base.js');
|
||||
/*#*/ include('core/Callback.js');
|
||||
/*#*/ include('core/PaperScope.js');
|
||||
/*#*/ include('core/PaperScopeItem.js');
|
||||
|
||||
/*#*/ if (options.version == 'dev') {
|
||||
// We can only load constants after core, since Numerical.js is loaded and
|
||||
// requires on Base.exports for exporting.
|
||||
/*#*/ include('constants.js');
|
||||
/*#*/ } // options.version == 'dev'
|
||||
|
||||
/*#*/ include('util/Formatter.js');
|
||||
/*#*/ include('util/Numerical.js');
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var Numerical = Base.exports.Numerical = new function() {
|
||||
var Numerical = new function() {
|
||||
|
||||
// Lookup tables for abscissas and weights with values for n = 2 .. 16.
|
||||
// As values are symetric, only store half of them and addapt algorithm
|
||||
|
|
Loading…
Reference in a new issue