[Webkit-unassigned] [Bug 189914] New: Throws incorrectly a syntax error when declaring a top level catch variable the same as a parameter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 24 06:46:27 PDT 2018


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

            Bug ID: 189914
           Summary: Throws incorrectly a syntax error when declaring a top
                    level catch variable the same as a parameter
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: seba.kerckhof at gmail.com

I wouldn't write code like this (below) myself, but it was emitted by the minifier and so my app doesn't work in Safari, or Safari TP (build 65 / 10 september 2018).
The code looks legal to me ...

class Foo{
  foo(o){
    try{

    }catch({ o }){

    }
  }
}
results in "SyntaxError: unexpected token: '}'. Cannot declare a lexical variable twice: 'o'."

And the variation:
class Foo{
  foo(o){
    try{

    }catch({ prop: o }){

    }
  }
}

results in "SyntaxError: unexpected identifier 'o'. Cannot declare a lexical variable twice: 'o'."

-- 
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/20180924/a8d80d36/attachment-0001.html>


More information about the webkit-unassigned mailing list