PaperScript: Only translate == to equals() calls for Point, Size and Color.

Closes #1043
This commit is contained in:
Jürg Lehni 2016-06-10 13:41:36 +02:00
parent 648beb33e9
commit 964d8cf7d6
2 changed files with 5 additions and 4 deletions

View file

@ -107,6 +107,8 @@ contribute to the code.
- `Matrix` properties `#b` and `#c` have been reversed to match common standard.
- `#importSVG()`: improve handling of style inheritance for nested `<defs>`.
- Move `PaperScript#execute()` URL argument into `options.url` (#902).
- PaperScript: Only translate `==` to `equals() calls for `Point`, `Size` and
`Color` (#1043).
### Added
- Use unified code-base for browsers, Node.js, Electron, and anything

View file

@ -31,9 +31,8 @@ Base.exports.PaperScript = (function() {
'*': '__multiply',
'/': '__divide',
'%': '__modulo',
// Use the real equals.
'==': 'equals',
'!=': 'equals'
'==': '__equals',
'!=': '__equals'
};
var unaryOperators = {
@ -43,7 +42,7 @@ Base.exports.PaperScript = (function() {
// Inject underscored math methods as aliases to Point, Size and Color.
var fields = Base.each(
['add', 'subtract', 'multiply', 'divide', 'modulo', 'negate'],
['add', 'subtract', 'multiply', 'divide', 'modulo', 'equals', 'negate'],
function(name) {
// Create an alias for each math method to be injected into the
// classes using Straps.js' #inject()