Some tweaks to potentially support strict mode.

This commit is contained in:
Jürg Lehni 2016-07-07 06:21:20 +02:00
parent f04dd14309
commit 866dcb50dd
3 changed files with 6 additions and 4 deletions

View file

@ -14,7 +14,7 @@
* @name PaperScript
* @namespace
*/
Base.exports.PaperScript = (function() {
Base.exports.PaperScript = function() {
// Locally turn of exports and define for inlined acorn.
// Just declaring the local vars is enough, as they will be undefined.
var exports, define,
@ -590,4 +590,4 @@ Base.exports.PaperScript = (function() {
};
// Pass on `this` as the binding object, so we can reference Acorn both in
// development and in the built library.
}).call(this);
}.call(this);

View file

@ -123,4 +123,4 @@ var paper = function(self, undefined) {
/*#*/ include('export.js');
return paper;
}(typeof self === 'object' ? self : null);
}.call(this, typeof self === 'object' ? self : null);

View file

@ -171,7 +171,9 @@ var Style = Base.extend(new function() {
var old = this._values[key];
if (old !== value) {
if (isColor) {
if (old)
// The old value may be a native string or other color
// description that wasn't coerced to a color object yet
if (old && old._owner !== undefined)
old._owner = undefined;
if (value && value.constructor === Color) {
// Clone color if it already has an owner.