From e9fcd7195798a55252f40ba47194a176d3e31e51 Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Thu, 13 Apr 2006 22:49:56 +0000 Subject: [PATCH] Don't throw when given |for (i in null)| to match SpiderMonkey and to match users' expectations. bug 333911, r=brendan --- js/narcissus/jsexec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/narcissus/jsexec.js b/js/narcissus/jsexec.js index 5488b2d42e1..883c747c0b7 100644 --- a/js/narcissus/jsexec.js +++ b/js/narcissus/jsexec.js @@ -351,7 +351,10 @@ function execute(n, x) { execute(u, x); r = n.iterator; s = execute(n.object, x); - t = toObject(getValue(s), s, n.object); + v = getValue(s); + + // ECMA erratum: allow for (i in null) + t = v && toObject(v, s, n.object); a = []; for (i in t) a.push(i);