mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Use === for undefined comparisons.
This commit is contained in:
parent
1e8dffac08
commit
7956b50886
3 changed files with 5 additions and 5 deletions
2
lib/bootstrap.js
vendored
2
lib/bootstrap.js
vendored
|
@ -166,7 +166,7 @@ var Base = this.Base = new function() {
|
|||
|
||||
function each(iter, bind, asArray) {
|
||||
try {
|
||||
(asArray || asArray == undefined && isArray(this) ? forEach : forIn)
|
||||
(asArray || asArray === undefined && isArray(this) ? forEach : forIn)
|
||||
.call(this, iterator(iter), bind = bind || this);
|
||||
} catch (e) {
|
||||
if (e !== Base.stop) throw e;
|
||||
|
|
|
@ -174,7 +174,7 @@ var Curve = this.Curve = Base.extend({
|
|||
getParameter: function(length, t) {
|
||||
var args = this.getCurveValues();
|
||||
args.push(length);
|
||||
args.push(t == undefined ? length < 0 ? 1 : 0 : t);
|
||||
args.push(t === undefined ? length < 0 ? 1 : 0 : t);
|
||||
return Curve.getParameter.apply(Curve, args);
|
||||
},
|
||||
|
||||
|
@ -310,9 +310,9 @@ var Curve = this.Curve = Base.extend({
|
|||
|
||||
statics: {
|
||||
getLength: function(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, a, b) {
|
||||
if (a == undefined)
|
||||
if (a === undefined)
|
||||
a = 0;
|
||||
if (b == undefined)
|
||||
if (b === undefined)
|
||||
b = 1;
|
||||
if (p1x == c1x && p1y == c1y && p2x == c2x && p2y == c2y) {
|
||||
// Straight line
|
||||
|
|
|
@ -101,7 +101,7 @@ var Path = this.Path = PathItem.extend({
|
|||
if (segment._path)
|
||||
segment = new Segment(segment);
|
||||
segment._path = this;
|
||||
if (index == undefined) {
|
||||
if (index === undefined) {
|
||||
this._segments.push(segment);
|
||||
} else {
|
||||
this._segments.splice(index, 0, segment);
|
||||
|
|
Loading…
Reference in a new issue