Permalink
Browse files

Perlito5 - js - fix an infinite recursion in the runtime

  • Loading branch information...
1 parent d69c95a commit d6048988bec7363b61f710b3183896dc21dc8e10 @fglock committed Dec 3, 2012
Showing with 38 additions and 38 deletions.
  1. +18 −18 html/perlito5.js
  2. +2 −2 perlito5.pl
  3. +12 −12 src5/lib/Perlito5/Javascript2/Array.pm
  4. +6 −6 src5/lib/Perlito5/Javascript2/Runtime.pm
View
@@ -330,30 +330,30 @@ Object.defineProperty( Object.prototype, "p5hset", {
Object.defineProperty( Object.prototype, "p5incr", {
enumerable : false,
value : function (i) {
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return this[i];
}
});
Object.defineProperty( Object.prototype, "p5postincr", {
enumerable : false,
value : function (i) {
var v = this[i];
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return v;
}
});
Object.defineProperty( Object.prototype, "p5decr", {
enumerable : false,
value : function (i) {
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return this[i];
}
});
Object.defineProperty( Object.prototype, "p5postdecr", {
enumerable : false,
value : function (i) {
var v = this[i];
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return v;
}
});
@@ -520,14 +520,14 @@ p5bool = function(o) {
return false;
};
-p5incr = function(o) {
+p5incr_ = function(o) {
if (typeof o === "number") {
return o + 1;
}
return p5str_inc(p5str(o));
};
-p5decr = function(o) {
+p5decr_ = function(o) {
if (typeof o === "number") {
return o - 1;
}
@@ -837,7 +837,7 @@ Object.defineProperty( Array.prototype, "p5incr", {
enumerable : false,
value : function (i) {
if (i < 0) { i = this.length + i };
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return this[i];
}
});
@@ -846,15 +846,15 @@ Object.defineProperty( Array.prototype, "p5postincr", {
value : function (i) {
if (i < 0) { i = this.length + i };
var v = this[i];
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return v;
}
});
Object.defineProperty( Array.prototype, "p5decr", {
enumerable : false,
value : function (i) {
if (i < 0) { i = this.length + i };
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return this[i];
}
});
@@ -863,7 +863,7 @@ Object.defineProperty( Array.prototype, "p5postdecr", {
value : function (i) {
if (i < 0) { i = this.length + i };
var v = this[i];
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return v;
}
});
@@ -947,7 +947,7 @@ p5tie_array = function(v, List__) {
enumerable : false,
configurable : true,
value : function (i) {
- var value = p5incr(p5call(res, 'FETCH', [i]));
+ var value = p5incr_(p5call(res, 'FETCH', [i]));
p5call(res, 'STORE', [i, value]);
return value;
}
@@ -957,15 +957,15 @@ p5tie_array = function(v, List__) {
configurable : true,
value : function (i) {
var value = p5call(res, 'FETCH', [i]);
- p5call(res, 'STORE', [i, p5incr(value)]);
+ p5call(res, 'STORE', [i, p5incr_(value)]);
return value;
}
});
Object.defineProperty( v, "p5decr", {
enumerable : false,
configurable : true,
value : function (i) {
- var value = p5decr(p5call(res, 'FETCH', [i]));
+ var value = p5decr_(p5call(res, 'FETCH', [i]));
p5call(res, 'STORE', [i, value]);
return value;
}
@@ -975,7 +975,7 @@ p5tie_array = function(v, List__) {
configurable : true,
value : function (i) {
var value = p5call(res, 'FETCH', [i]);
- p5call(res, 'STORE', [i, p5decr(value)]);
+ p5call(res, 'STORE', [i, p5decr_(value)]);
return value;
}
});
@@ -1090,24 +1090,24 @@ function p5ArrayOfAlias(o) {
}
this.p5incr = function (i) {
if (i < 0) { i = this.length + i };
- this._array_[i+i][this._array_[i+i+1]] = p5incr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5incr_(this._array_[i+i][this._array_[i+i+1]]);
return this._array_[i+i][this._array_[i+i+1]];
}
this.p5postincr = function (i) {
if (i < 0) { i = this.length + i };
var v = this._array_[i+i][this._array_[i+i+1]];
- this._array_[i+i][this._array_[i+i+1]] = p5incr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5incr_(this._array_[i+i][this._array_[i+i+1]]);
return v;
}
this.p5decr = function (i) {
if (i < 0) { i = this.length + i };
- this._array_[i+i][this._array_[i+i+1]] = p5decr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5decr_(this._array_[i+i][this._array_[i+i+1]]);
return this._array_[i+i][this._array_[i+i+1]];
}
this.p5postdecr = function (i) {
if (i < 0) { i = this.length + i };
var v = this._array_[i+i][this._array_[i+i+1]];
- this._array_[i+i][this._array_[i+i+1]] = p5decr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5decr_(this._array_[i+i][this._array_[i+i+1]]);
return v;
}
this.p5aget_array = function (i) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -45,7 +45,7 @@ Object.defineProperty( Array.prototype, "p5incr", {
enumerable : false,
value : function (i) {
if (i < 0) { i = this.length + i };
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return this[i];
}
});
@@ -54,15 +54,15 @@ Object.defineProperty( Array.prototype, "p5postincr", {
value : function (i) {
if (i < 0) { i = this.length + i };
var v = this[i];
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return v;
}
});
Object.defineProperty( Array.prototype, "p5decr", {
enumerable : false,
value : function (i) {
if (i < 0) { i = this.length + i };
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return this[i];
}
});
@@ -71,7 +71,7 @@ Object.defineProperty( Array.prototype, "p5postdecr", {
value : function (i) {
if (i < 0) { i = this.length + i };
var v = this[i];
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return v;
}
});
@@ -155,7 +155,7 @@ p5tie_array = function(v, List__) {
enumerable : false,
configurable : true,
value : function (i) {
- var value = p5incr(p5call(res, 'FETCH', [i]));
+ var value = p5incr_(p5call(res, 'FETCH', [i]));
p5call(res, 'STORE', [i, value]);
return value;
}
@@ -165,15 +165,15 @@ p5tie_array = function(v, List__) {
configurable : true,
value : function (i) {
var value = p5call(res, 'FETCH', [i]);
- p5call(res, 'STORE', [i, p5incr(value)]);
+ p5call(res, 'STORE', [i, p5incr_(value)]);
return value;
}
});
Object.defineProperty( v, "p5decr", {
enumerable : false,
configurable : true,
value : function (i) {
- var value = p5decr(p5call(res, 'FETCH', [i]));
+ var value = p5decr_(p5call(res, 'FETCH', [i]));
p5call(res, 'STORE', [i, value]);
return value;
}
@@ -183,7 +183,7 @@ p5tie_array = function(v, List__) {
configurable : true,
value : function (i) {
var value = p5call(res, 'FETCH', [i]);
- p5call(res, 'STORE', [i, p5decr(value)]);
+ p5call(res, 'STORE', [i, p5decr_(value)]);
return value;
}
});
@@ -298,24 +298,24 @@ function p5ArrayOfAlias(o) {
}
this.p5incr = function (i) {
if (i < 0) { i = this.length + i };
- this._array_[i+i][this._array_[i+i+1]] = p5incr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5incr_(this._array_[i+i][this._array_[i+i+1]]);
return this._array_[i+i][this._array_[i+i+1]];
}
this.p5postincr = function (i) {
if (i < 0) { i = this.length + i };
var v = this._array_[i+i][this._array_[i+i+1]];
- this._array_[i+i][this._array_[i+i+1]] = p5incr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5incr_(this._array_[i+i][this._array_[i+i+1]]);
return v;
}
this.p5decr = function (i) {
if (i < 0) { i = this.length + i };
- this._array_[i+i][this._array_[i+i+1]] = p5decr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5decr_(this._array_[i+i][this._array_[i+i+1]]);
return this._array_[i+i][this._array_[i+i+1]];
}
this.p5postdecr = function (i) {
if (i < 0) { i = this.length + i };
var v = this._array_[i+i][this._array_[i+i+1]];
- this._array_[i+i][this._array_[i+i+1]] = p5decr(this._array_[i+i][this._array_[i+i+1]]);
+ this._array_[i+i][this._array_[i+i+1]] = p5decr_(this._array_[i+i][this._array_[i+i+1]]);
return v;
}
this.p5aget_array = function (i) {
@@ -336,30 +336,30 @@ Object.defineProperty( Object.prototype, "p5hset", {
Object.defineProperty( Object.prototype, "p5incr", {
enumerable : false,
value : function (i) {
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return this[i];
}
});
Object.defineProperty( Object.prototype, "p5postincr", {
enumerable : false,
value : function (i) {
var v = this[i];
- this[i] = p5incr(this[i]);
+ this[i] = p5incr_(this[i]);
return v;
}
});
Object.defineProperty( Object.prototype, "p5decr", {
enumerable : false,
value : function (i) {
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return this[i];
}
});
Object.defineProperty( Object.prototype, "p5postdecr", {
enumerable : false,
value : function (i) {
var v = this[i];
- this[i] = p5decr(this[i]);
+ this[i] = p5decr_(this[i]);
return v;
}
});
@@ -526,14 +526,14 @@ p5bool = function(o) {
return false;
};
-p5incr = function(o) {
+p5incr_ = function(o) {
if (typeof o === "number") {
return o + 1;
}
return p5str_inc(p5str(o));
};
-p5decr = function(o) {
+p5decr_ = function(o) {
if (typeof o === "number") {
return o - 1;
}

0 comments on commit d604898

Please sign in to comment.