grafana / sobek

MIT License
122 stars 1 forks source link

ESM issue: comparing namespace objects leads to exceptions #38

Open mstoykov opened 2 months ago

mstoykov commented 2 months ago
        `a.js`: `
            import * as ns from "dep.js"
            if (ns != "some value") {
                globalThis.s = 5
            };
        `,
        `dep.js`: `
            export let s = 42;
        `,

Will lead to

TypeError: Could not convert &{{ 0xc0001df2f0 false map[] [] 0 0 0xc0001df380 map[]} 0xc0001c4140 map[s:{}] [s]} to primitive\n\tat a.js:3:8(12)

While it is expected that this will fail, not being able to compare them at all, and having exceptions seems worse.