« Bugzilla Issues Index

#274 — S13.2.1_A7_T3 erroneously declares global var

S13.2.1_A7_T3 initially declares the variable "x" in global scope with a standard variable statement. This is actually wrong since the first check tests whether getValue() throws a ReferenceError for an unresolvable reference.
So the first statement in S13.2.1_A7_T3 must not be "var x;".

Also compare to the original Sputnik test case.

Bug No.2 in S13.2.1_A7_T3:
The '$ERROR()' function should never be called within a try-catch block if the catch-block is empty. At least if the '$ERROR()' implementation from sta.js is used which simply throws a 'Test262Error' instance. Surrounding the '$ERROR()' call in try-catch will now catch the 'Test262Error'...
try {
/* code which is expected to throw an error */
} catch (e) {}

=> should be rewritten to:

try {
/* code which is expected to throw an error */
} catch (e) {
if (e instanceof Test262Error) throw e;

No idea why the 'var x;' was ever removed.

Bug #2 below is a frightening oversight. Looks like the following might be affected as well:
E:\262\test262\test\suite\ch12\12.6\12.6.1\S12.6.1_A2.js(14):} catch (e) {}
E:\262\test262\test\suite\ch12\12.6\12.6.1\S12.6.1_A9.js(20):} catch (e) {}
E:\262\test262\test\suite\ch12\12.6\12.6.2\S12.6.2_A9.js(20):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.1_A7_T3.js(24):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.1_A7_T4.js(23):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.1_A7_T4.js(50):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.2_A11.js(26):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.2_A13.js(24):} catch (e) {}
E:\262\test262\test\suite\ch13\13.2\S13.2.2_A9.js(26):} catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.1_A2.2_T1.js(28): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.1_A2.3_T1.js(24): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.1_A2.4_T1.js(28): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.1_A2.5_T1.js(32): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.2_A2.2_T1.js(22): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.2_A2.3_T1.js(24): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.2_A2.4_T1.js(28): } catch (e) {}
E:\262\test262\test\suite\ch15\15.1\15.1.3\\S15.1.3.2_A2.5_T1.js(32): } catch (e) {}
E:\262\test262\test\suite\ch15\15.11\15.11.4\S15.11.4_A3.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.11\15.11.4\S15.11.4_A4.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.3\S15.5.3.2_A4.js(20):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.10_A7.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.11_A7.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.14_A7.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.5_A7.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.6_A7.js(16):} catch (e) {}
E:\262\test262\test\suite\ch15\15.5\15.5.4\\S15.5.4.9_A7.js(16):} catch (e) {}

Fixed S13.2.1_A7_T3.js plus all the others I called out above in Hg.