michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 620130; michael@0: var summary = michael@0: "Calls to eval with same code + varying strict mode of script containing " + michael@0: "eval == fail"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: function t(code) { return eval(code); } michael@0: michael@0: assertEq(t("'use strict'; try { eval('with (5) 17'); } catch (e) { 'threw'; }"), michael@0: "threw"); michael@0: assertEq(t("try { eval('with (5) 17'); } catch (e) { 'threw'; }"), michael@0: 17); michael@0: assertEq(t("'use strict'; try { eval('with (5) 17'); } catch (e) { 'threw'; }"), michael@0: "threw"); michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");