diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ac32b88..5e7cffba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ``. - 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 diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index efb8f52b..d0d8e5bb 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -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()