diff --git a/test/harness/sta.js b/test/harness/sta.js index fd3873438a1a107b0478900ecd51ec0e09d68865..19547c223df4df55a12acb4caf87b4bd034bceb3 100644 --- a/test/harness/sta.js +++ b/test/harness/sta.js @@ -141,10 +141,22 @@ SimpleTestAPIs.push(fnSupportsStrict); //----------------------------------------------------------------------------- function fnGlobalObject() { - return (function() { return this }).call(null); + return Function("return this")(); } SimpleTestAPIs.push(fnGlobalObject); +//----------------------------------------------------------------------------- +function fnSupportsStrict() { + "use strict"; + try { + eval('with ({}) {}'); + return false; + } catch (e) { + return true; + } +} +SimpleTestAPIs.push(fnSupportsStrict); + //----------------------------------------------------------------------------- //Verify all attributes specified data property of given object: value, writable, enumerable, configurable //If all attribute values are expected, return true, otherwise, return false diff --git a/test/harness/sth.js b/test/harness/sth.js index 5d533f9743dd47d109a41432506899c00876761a..fc83cfbf34a0c09bb1b9d462ffaa6c3425d7fc3f 100644 --- a/test/harness/sth.js +++ b/test/harness/sth.js @@ -129,7 +129,8 @@ function BrowserRunner() { " if(test.precondition && !test.precondition()) {" + " testRun(test.id, test.path, test.description, test.test.toString(),typeof test.precondition !== 'undefined' ? test.precondition.toString() : '', 'fail', 'Precondition Failed');" + " } else {" + - " try { var res = test.test.call(window); } catch(e) { res = 'fail'; error = e; }" + + " var testThis = test.strict===undefined ? window : undefined;" + + " try { var res = test.test.call(testThis); } catch(e) { res = 'fail'; error = e; }" + " var retVal = /^s/i.test(test.id) ? (res === true || typeof res === 'undefined' ? 'pass' : 'fail') : (res === true ? 'pass' : 'fail');" + " testRun(test.id, test.path, test.description, test.test.toString(), typeof test.precondition !== 'undefined' ? test.precondition.toString() : '', retVal, error);" + " }" + diff --git a/tools/misc/move_test.py b/tools/misc/FixTestCasePlacement.py similarity index 100% rename from tools/misc/move_test.py rename to tools/misc/FixTestCasePlacement.py