mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Use Error constructor correctly.
This commit is contained in:
parent
484d74160b
commit
46a0589547
4 changed files with 5 additions and 4 deletions
|
@ -54,7 +54,7 @@ var Matrix = Base.extend({
|
||||||
this._m10 = this._m01 = this._m02 = this._m12 = 0;
|
this._m10 = this._m01 = this._m02 = this._m12 = 0;
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
throw Error('Unsupported matrix parameters');
|
throw new Error('Unsupported matrix parameters');
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@ var Gradient = Base.extend({
|
||||||
|
|
||||||
setStops: function(stops) {
|
setStops: function(stops) {
|
||||||
if (stops.length < 2)
|
if (stops.length < 2)
|
||||||
throw Error('Gradient stop list needs to contain at least two stops.');
|
throw new Error('Gradient stop list needs to contain at least two stops.');
|
||||||
this._stops = stops;
|
this._stops = stops;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,7 +64,8 @@ var RGBColor = Color.extend(new function() {
|
||||||
|
|
||||||
function namedToComponents(name) {
|
function namedToComponents(name) {
|
||||||
var hex = namedColors[name];
|
var hex = namedColors[name];
|
||||||
if (!hex) throw Error('The named color "' + name + '" does not exist.');
|
if (!hex)
|
||||||
|
throw new Error('The named color "' + name + '" does not exist.');
|
||||||
return hex && hexToComponents(hex);
|
return hex && hexToComponents(hex);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ var CompoundPath = PathItem.extend({
|
||||||
if (that.children.length) {
|
if (that.children.length) {
|
||||||
return that.children[that.children.length - 1];
|
return that.children[that.children.length - 1];
|
||||||
} else {
|
} else {
|
||||||
throw Error('Use a moveTo() command first');
|
throw new Error('Use a moveTo() command first');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue