Move define() statement to export.js and remove define hack in PaperScript.

This commit is contained in:
Jürg Lehni 2013-06-24 04:40:35 -07:00
parent 4b53d558f1
commit eef736f3d8
3 changed files with 4 additions and 6 deletions

View file

@ -19,8 +19,6 @@
// better minification and the future use of strict mode once it makes sense
// in terms of performance.
paper.PaperScope.prototype.PaperScript = new function() {
// Locally override define, so acorn.js does not export itself
var define = null;
/*#*/ if (options.parser == 'acorn') {
/*#*/ include('../../lib/acorn-min.js');
/*#*/ } else if (options.parser == 'esprima') {

View file

@ -20,3 +20,7 @@ paper = new (PaperScope.inject(Base.merge(Base.exports, {
DomElement: DomElement,
DomEvent: DomEvent
})))();
// Support AMD (e.g. require.js)
if (typeof define === 'function' && define.amd)
define(paper);

View file

@ -131,7 +131,3 @@ return paper;
// include PaperScript separately outside the main paper scope, due to its use
// of with(). This also simplifies making its inclusion optional.
/*#*/ include('core/PaperScript.js');
// Support AMD (e.g. require.js)
if (typeof define === 'function' && define.amd)
define(paper);