Bug 159309 - Wrong error message in TypeError produced by for..of with null object
Summary: Wrong error message in TypeError produced by for..of with null object
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-30 12:41 PDT by Joseph Pecoraro
Modified: 2016-06-30 12:41 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-06-30 12:41:05 PDT
Summary:
Wrong error message in TypeError produced by for..of with null object

Test:
<script>
function foo() {
    let chain = Promise.resolve();
    for (let x of null)
        console.log(x);
}
foo();
</script>

Steps to Reproduce:
1. Load test case without the inspector open
2. Open the inspector to view the uncaught exception
  => Wrong message, but points to the correct location
    [Error] TypeError: null is not an object (evaluating 'Promise.resolve()')