mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 14:20:12 -04:00
Remove filepp.pl as preprocessor and switch to our own Prepro.js, a simple preprocesssor for JavaScript that speaks JavaScript, written in JavaScript, allowing preprocessing to either happen at build time or compile time.
This commit is contained in:
parent
a0a426982f
commit
8eaeb7fb5e
9 changed files with 168 additions and 2995 deletions
src/core
|
@ -19,7 +19,7 @@
|
|||
* @namespace
|
||||
*/
|
||||
var PaperScript = this.PaperScript = new function() {
|
||||
//#include "../../lib/parse-js-min.js"
|
||||
/*#*/ include('../../lib/parse-js-min.js');
|
||||
|
||||
// Math Operators
|
||||
|
||||
|
@ -153,7 +153,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
* @return {Object} The result of the code evaluation.
|
||||
*/
|
||||
function evaluate(code, scope) {
|
||||
//#ifdef BROWSER
|
||||
/*#*/ if (options.browser) {
|
||||
// See if it's a script tag or a string
|
||||
if (typeof code !== 'string') {
|
||||
// If a canvas id is provided, create a project for it now,
|
||||
|
@ -171,7 +171,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
code = code.innerHTML;
|
||||
}
|
||||
}
|
||||
//#endif // BROWSER
|
||||
/*#*/ } // options.browser
|
||||
// Set currently active scope.
|
||||
paper = scope;
|
||||
var view = scope.view,
|
||||
|
@ -224,7 +224,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
return res;
|
||||
}
|
||||
|
||||
//#ifdef BROWSER
|
||||
/*#*/ if (options.browser) {
|
||||
// Code borrowed from Coffee Script:
|
||||
function request(url, scope) {
|
||||
var xhr = new (window.ActiveXObject || XMLHttpRequest)(
|
||||
|
@ -287,14 +287,14 @@ var PaperScript = this.PaperScript = new function() {
|
|||
hasAttribute: handleAttribute('has')
|
||||
};
|
||||
|
||||
//#else // !BROWSER
|
||||
/*#*/ } else { // !options.browser
|
||||
|
||||
return {
|
||||
compile: compile,
|
||||
evaluate: evaluate
|
||||
};
|
||||
|
||||
//#endif // !BROWSER
|
||||
/*#*/ } // !options.browser
|
||||
};
|
||||
|
||||
// Export load directly:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue