mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Cope with localStorage reifying __iterator__ with null value, and the like (573875, r=gal).
This commit is contained in:
parent
b5d79c6a75
commit
6e8832e1a8
@ -404,8 +404,10 @@ GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
|
||||
return false;
|
||||
|
||||
/* If there is no custom __iterator__ method, we are done here. */
|
||||
if (vp->isUndefined())
|
||||
if (!vp->isObject()) {
|
||||
vp->setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Otherwise call it and return that object. */
|
||||
LeaveTrace(cx);
|
||||
|
@ -29,6 +29,7 @@ script regress-567152.js
|
||||
script regress-569306.js
|
||||
script regress-569464.js
|
||||
script regress-571014.js
|
||||
script regress-573875.js
|
||||
script regress-577648-1.js
|
||||
script regress-577648-2.js
|
||||
script regress-583429.js
|
||||
|
21
js/src/tests/js1_8_5/regress/regress-573875.js
Normal file
21
js/src/tests/js1_8_5/regress/regress-573875.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
*/
|
||||
|
||||
var o = {__iterator__:null, a:1, b:2, c:3}
|
||||
var expect = '__iterator__,a,b,c,';
|
||||
var actual = '';
|
||||
|
||||
try {
|
||||
for (var i in o)
|
||||
actual += i + ',';
|
||||
} catch (e) {
|
||||
actual = '' + e;
|
||||
if (/invalid __iterator__ value/.test(actual) ||
|
||||
/null is not a function/.test(actual)) {
|
||||
expect = actual;
|
||||
}
|
||||
}
|
||||
|
||||
reportCompare(expect, actual, "ok");
|
Loading…
Reference in New Issue
Block a user