Closed Bug 1634037 Opened 5 years ago Closed 5 years ago

No error logged on ES module import reassignment

Categories

(DevTools :: Console, enhancement)

75 Branch
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

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.

Component: Untriaged → Console
Product: Firefox → DevTools
Version: 68 Branch → 75 Branch

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.

Flags: needinfo?(zak_bruno35)

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!

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(zak_bruno35)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.