[Webkit-unassigned] [Bug 220142] New: A possible issue about variable redeclaration

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 24 05:20:53 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=220142

            Bug ID: 220142
           Summary: A possible issue about variable redeclaration
           Product: WebKit
           Version: WebKit Local Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nwu_ty at 163.com

# Version
d940b47(https://github.com/WebKit/WebKit-http/commit/d940b477848884f63752d25491d9dd0b9d3ccb2d)

# Testcase1:
// Will throw an SyntaxError
function func() {
    if (1) {
        function o() {}
        var o = 1;
    }
}

# Testcase2:
// Will not throw an SyntaxError
if (1) {
    function o() {};
    var o = 1;
}

# Description
In both of the above examples, an variable 'o' declaration error occurred, however Testcase1 throws an exception and Testcase2 doesn't.

I've tried other engines(such as V8, SpiderMonkey), and they all throw SyntaxError, So i suspect it's a bug of jsc.

Please let me know the result whether this is a bug or not. Looking forward to your reply, thanks! ��

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201224/73239550/attachment.htm>


More information about the webkit-unassigned mailing list