New issue
Advanced search Search tips

Issue 634364 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

constants are not accessible inside functions not defined inside a try-catch block

Reported by derek.se...@sap.com, Aug 4 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Steps to reproduce the problem:
Create a javascript file with global constants (keyword const es6).  Try to access them inside a function.  Now define the functions inside a try-catch block and try again.

What is the expected behavior?
Global constants should always be accessible within functions.

What went wrong?
Global constants are not in scope unless the function is defined within a try-catch block.

Did this work before? N/A 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 22.0 r0
 

Comment 1 by tkent@chromium.org, Aug 4 2016

Components: -Blink Blink>JavaScript
Please provide a reproducible HTML file.

Labels: Needs-Bisect
Labels: Needs-Feedback
Cc: adamk@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>Language
Related to https://bugs.chromium.org/p/v8/issues/detail?id=3305 ?

Comment 5 by adamk@chromium.org, Aug 5 2016

Labels: -Needs-Bisect
Without a clearer outline of the reported problem there's not much I can do. For example, the following code works fine:


```
const foo = 5;
function f() {
  return foo;
}
```

as would:

```
const foo = 5;
try {
function f() {
  return foo;
}
} catch (e) {}
```
Status: WontFix (was: Unconfirmed)
Closing until a repro is supplied.
Cc: hablich@chromium.org

Sign in to add a comment