No error logged on ES module import reassignment
Categories
(DevTools :: Console, enhancement)
Tracking
(Not tracked)
People
(Reporter: zak_bruno35, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
/* module.js */
export let foo = false;
/* index.js */
import { foo } from "./module.js";
console.log(foo); // false
foo = true;
console.log(foo);
Actual results:
Execution stops right at the line foo = true;, the second log is never reached.
No error is thrown.
Expected results:
As imports are read-only views on exports, I would not expect the reassignment to work, thus the second log to be reached.
I would however expect an error to be thrown in the console, having some explanations.
Comment 1•5 years ago
|
||
Hello Bruno,
I put up a simple test page : https://es-module-reassign.glitch.me/ , and I do see the following error (tested in Firefox 74, 75 and 77):
TypeError: "foo" is read-only
could you check if you see it on the test page ?
If not, maybe you have the "Error" filter disabled? Or a search in the console filter input? Or maybe nothing of that kind, and there's an issue we need to investigate further.
Updated•5 years ago
|
I feel dumb right now :) Bug can be closed.
I have no idea why my error filter was off, I never put it off...
Anyway, works as intended, my bad!
Description
•