js/src/tests/ecma_5/extensions/strict-function-toSource.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /*
     2  * Bug 800407 - Functions defined with Function construcor
     3  * do have strict mode when JSOPTION_STRICT_MODE is on.
     4  */
     6 options("strict_mode");
     7 function testRunOptionStrictMode(str, arg, result) {
     8     var strict_inner = new Function('return typeof this == "undefined";');
     9     return strict_inner;
    10 }
    11 assertEq(eval(uneval(testRunOptionStrictMode()))(), true);
    13 if (typeof decompileBody !== "undefined") {
    14     assertEq(decompileBody(new Function('x', 'return x*2;')).contains('\n"use strict"'), true);
    15 }
    17 reportCompare(true, true);

mercurial