mirror of https://github.com/tc39/test262.git
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:
parent
09186bafb4
commit
08a7f7433a
|
@ -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
|
||||
|
|
|
@ -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);" +
|
||||
" }" +
|
||||
|
|
Loading…
Reference in New Issue