mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Merge remote branch 'origin/master'
This commit is contained in:
commit
c00f85c9e5
1 changed files with 5 additions and 5 deletions
|
@ -14,7 +14,7 @@ var PaperScript = new function() {
|
|||
'!=': 'equals'
|
||||
};
|
||||
|
||||
function $operator(left, operator, right) {
|
||||
function $eval(left, operator, right) {
|
||||
var handler = operators[operator];
|
||||
if (left && left[handler]) {
|
||||
var res = left[handler](right);
|
||||
|
@ -35,12 +35,12 @@ var PaperScript = new function() {
|
|||
|
||||
// Handle Sign Operators
|
||||
|
||||
var signs = {
|
||||
var signOperators = {
|
||||
'-': 'negate'
|
||||
};
|
||||
|
||||
function $sign(operator, value) {
|
||||
var handler = signs[operator];
|
||||
var handler = signOperators[operator];
|
||||
if (value && value[handler]) {
|
||||
return value[handler]();
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ var PaperScript = new function() {
|
|||
// is potentially an object.
|
||||
if (operators[operator] && isDynamic(left)) {
|
||||
// Replace with call to $operator(left, operator, right):
|
||||
return ['call', ['name', '$operator'],
|
||||
return ['call', ['name', '$eval'],
|
||||
[left, ['string', operator], right]];
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ var PaperScript = new function() {
|
|||
},
|
||||
|
||||
'unary-prefix': function(operator, exp) {
|
||||
if (signs[operator] && isDynamic(exp)) {
|
||||
if (signOperators[operator] && isDynamic(exp)) {
|
||||
return ['call', ['name', '$sign'],
|
||||
[['string', operator], walk(exp)]];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue