mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
Switch from options.browser and options.node to options.environment
This commit is contained in:
parent
6b45a9382c
commit
c68a7d33da
10 changed files with 42 additions and 39 deletions
src/core
|
@ -288,7 +288,7 @@ paper.PaperScope.prototype.PaperScript = (function(root) {
|
|||
return res;
|
||||
}
|
||||
|
||||
/*#*/ if (options.browser) {
|
||||
/*#*/ if (options.environment == 'browser') {
|
||||
// Code borrowed from Coffee Script:
|
||||
function request(url, scope) {
|
||||
var xhr = new (window.ActiveXObject || XMLHttpRequest)(
|
||||
|
@ -354,8 +354,8 @@ paper.PaperScope.prototype.PaperScript = (function(root) {
|
|||
load: load
|
||||
};
|
||||
|
||||
/*#*/ } else { // !options.browser
|
||||
/*#*/ if (options.node) {
|
||||
/*#*/ } else { // !options.environment == 'browser'
|
||||
/*#*/ if (options.environment == 'node') {
|
||||
|
||||
// Register the .pjs extension for automatic compilation as PaperScript
|
||||
|
||||
|
@ -374,12 +374,12 @@ paper.PaperScope.prototype.PaperScript = (function(root) {
|
|||
module.exports = scope;
|
||||
};
|
||||
|
||||
/*#*/ } // options.node
|
||||
/*#*/ } // options.environment == 'node'
|
||||
|
||||
return {
|
||||
compile: compile,
|
||||
evaluate: evaluate
|
||||
};
|
||||
|
||||
/*#*/ } // !options.browser
|
||||
/*#*/ } // !options.environment == 'browser'
|
||||
})(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue