Handle exporting of Numerical and PaperScript in export.js

Allowing build.sh to work again.
This commit is contained in:
Jürg Lehni 2013-05-27 18:28:35 -07:00
parent 099a5546cb
commit 961451b271
5 changed files with 13 additions and 11 deletions

View file

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

View file

@ -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 = {

View file

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

View file

@ -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');

View file

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