Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 48573ff

Browse files
committed
fix(zone): keep argument[0] refs around.
Without this fix, zone.js creates infinite loops when running in non-strict mode. Closes: #57
1 parent 3a3dae4 commit 48573ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zone.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ Zone.patchSetClearFn = function (obj, fnNames) {
123123
var bindArgs = setName === 'setInterval' ? Zone.bindArguments : Zone.bindArgumentsOnce;
124124

125125
zone[setName] = function (fn) {
126-
var id;
126+
var id, fnRef = fn;
127127
arguments[0] = function () {
128128
delete ids[id];
129-
return fn.apply(this, arguments);
129+
return fnRef.apply(this, arguments);
130130
};
131131
var args = bindArgs(arguments);
132132
id = delegate.apply(obj, args);
@@ -164,8 +164,9 @@ Zone.patchSetFn = function (obj, fnNames) {
164164

165165
if (delegate) {
166166
zone[name] = function (fn) {
167+
var fnRef = fn;
167168
arguments[0] = function () {
168-
return fn.apply(this, arguments);
169+
return fnRef.apply(this, arguments);
169170
};
170171
var args = Zone.bindArgumentsOnce(arguments);
171172
return delegate.apply(obj, args);

0 commit comments

Comments
 (0)