Few minor changes to sta.js and sth.js to support Strict Mode.

Renamed move_test.py to FixTestCasePlacement.py. Still a work in progress.
This commit is contained in:
David Fugate 2011-04-07 10:12:45 -07:00
parent 09186bafb4
commit 08a7f7433a
3 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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);" +
" }" +