Bug 188930 - JSC should evaluate scoped function block after an eval statement
Summary: JSC should evaluate scoped function block after an eval statement
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 11
Hardware: Unspecified iOS 10.3
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-24 13:47 PDT by Sotero Jr
Modified: 2018-08-29 20:31 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sotero Jr 2018-08-24 13:47:39 PDT
Hi everyone,

I found out an inconsistency if we try to evaluate a scoped function block after an eval statement. If I remove the first line (eval line), JSC works as expected.

Version: 235318
O.S: MacOS High Sierra Version 10.13.6

step to reproduce:
eval("if (false) function _f() {} else function f() { return 1; }");
{
   function f() {
      return 2;
   }
}

print(f())

atual result: 
1

expected result:
2

V8, Chakra and SpiderMonkey works as expected 

cinfuzz