Bug 160992
| Summary: | Wrong error message for a program that calls a function with arguments that do a getByVal off of undefined | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | benjamin, fpizlo, ggaren, gskachkov, jfbastien, joepeck, keith_miller, mark.lam, msaboff, oliver, sukolsak, ticaiolima, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Saam Barati
We print the wrong error message in this program:
```
function foo() {
let additions = [
[10, 20],
//[{}, Symbol()]
[{}, {}]
];
let addedAdditions = [];
let allItems = [];
let map = new Map;
map.set('foo', 'bar');
map.set(20, {});
//let item;
for (let item of map) {
if (item[0] === 20) {
map.delete(20);
map.set(30, 40);
}
print(JSON.stringify(item));
let addition = additions.pop();
addedAdditions.push(addition);
allItems.push(item);
print(addition);
map.set(addition[0], addition[1]);
}
}
foo();
```
We print:
Exception: TypeError: undefined is not an object (evaluating 'map.set')
even though it's "addition[0]" where the undefined load is happening.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Joseph Pecoraro
This is fixed by bug 163426!
*** This bug has been marked as a duplicate of bug 163426 ***