[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

oliver at apple.com oliver at apple.com
Wed Dec 22 14:44:21 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b9435e9a06dd682a52c25292403c9a6022fa16db
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 18 23:28:58 2010 +0000

    2010-10-18  Oliver Hunt  <oliver at apple.com>
    
            Reviewed by Sam Weinig.
    
            Strict mode: Functions created with the function constructor don't implement strict mode semantics
            https://bugs.webkit.org/show_bug.cgi?id=47860
    
            When creating the FunctionExecutable for a new function the function constructor
            was always passing false for whether or not a function was strict, rather than
            using the information from the freshly parsed function itself.
    
            * runtime/Executable.cpp:
            (JSC::FunctionExecutable::fromGlobalCode):
    2010-10-18  Oliver Hunt  <oliver at apple.com>
    
            Reviewed by Sam Weinig.
    
            Strict mode: Functions created with the function constructor don't implement strict mode semantics
            https://bugs.webkit.org/show_bug.cgi?id=47860
    
            Test that the function constructor produces correct strict mode functions.
    
            * fast/js/basic-strict-mode-expected.txt:
            * fast/js/script-tests/basic-strict-mode.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70008 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index c0b4edc..5332ed8 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,19 @@
 2010-10-18  Oliver Hunt  <oliver at apple.com>
 
+        Reviewed by Sam Weinig.
+
+        Strict mode: Functions created with the function constructor don't implement strict mode semantics
+        https://bugs.webkit.org/show_bug.cgi?id=47860
+
+        When creating the FunctionExecutable for a new function the function constructor
+        was always passing false for whether or not a function was strict, rather than
+        using the information from the freshly parsed function itself.
+
+        * runtime/Executable.cpp:
+        (JSC::FunctionExecutable::fromGlobalCode):
+
+2010-10-18  Oliver Hunt  <oliver at apple.com>
+
         Reviewed by Darin Adler.
 
         Strict mode: |this| should be undefined if it is not explicitly provided
diff --git a/JavaScriptCore/runtime/Executable.cpp b/JavaScriptCore/runtime/Executable.cpp
index 733768e..2ad4b2d 100644
--- a/JavaScriptCore/runtime/Executable.cpp
+++ b/JavaScriptCore/runtime/Executable.cpp
@@ -361,7 +361,7 @@ PassRefPtr<FunctionExecutable> FunctionExecutable::fromGlobalCode(const Identifi
     FunctionBodyNode* body = static_cast<FuncExprNode*>(funcExpr)->body();
     ASSERT(body);
 
-    return FunctionExecutable::create(&exec->globalData(), functionName, body->source(), body->usesArguments(), body->parameters(), false, body->lineNo(), body->lastLine());
+    return FunctionExecutable::create(&exec->globalData(), functionName, body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
 }
 
 UString FunctionExecutable::paramString() const
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7635627..c85cc8a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-18  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Strict mode: Functions created with the function constructor don't implement strict mode semantics
+        https://bugs.webkit.org/show_bug.cgi?id=47860
+
+        Test that the function constructor produces correct strict mode functions.
+
+        * fast/js/basic-strict-mode-expected.txt:
+        * fast/js/script-tests/basic-strict-mode.js:
+
 2010-10-18  James Robinson  <jamesr at chromium.org>
 
         Mark flaky SVG tests as flaky in chromium test expectations.
diff --git a/LayoutTests/fast/js/basic-strict-mode-expected.txt b/LayoutTests/fast/js/basic-strict-mode-expected.txt
index 6741c54..a92383f 100644
--- a/LayoutTests/fast/js/basic-strict-mode-expected.txt
+++ b/LayoutTests/fast/js/basic-strict-mode-expected.txt
@@ -21,6 +21,8 @@ PASS testThisBracketAccess.call(undefined, 'length') threw exception TypeError:
 PASS testThisBracketAccess.call(true, 'length') is undefined.
 PASS testThisBracketAccess.call(false, 'length') is undefined.
 PASS testThisBracketAccess.call(1, 'length') is undefined.
+PASS Function('"use strict"; return this;')() is undefined.
+PASS Function('"use strict"; with({});') threw exception SyntaxError: Parse error.
 PASS testGlobalAccess() is undefined
 PASS testThis.call() is undefined
 PASS testThis.apply() is undefined
diff --git a/LayoutTests/fast/js/script-tests/basic-strict-mode.js b/LayoutTests/fast/js/script-tests/basic-strict-mode.js
index 51b3510..42c2a90 100644
--- a/LayoutTests/fast/js/script-tests/basic-strict-mode.js
+++ b/LayoutTests/fast/js/script-tests/basic-strict-mode.js
@@ -34,6 +34,8 @@ shouldThrow("testThisBracketAccess.call(undefined, 'length')");
 shouldBeUndefined("testThisBracketAccess.call(true, 'length')");
 shouldBeUndefined("testThisBracketAccess.call(false, 'length')");
 shouldBeUndefined("testThisBracketAccess.call(1, 'length')");
+shouldBeUndefined("Function('\"use strict\"; return this;')()");
+shouldThrow("Function('\"use strict\"; with({});')");
 
 
 shouldBe("testGlobalAccess()", "undefined");

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list