Open RichDom2185 opened 1 year ago
Totals | |
---|---|
Change from base Build 7593229382: | -0.001% |
Covered Lines: | 10896 |
Relevant Lines: | 12709 |
If multiple files alias the same import the name information is lost
// a.js
import { show as s } from 'rune';
export function a(x) {
return s(x);
}
// b.js
import { show as b } from 'rune';
import { a } from './a.js';
b(0);
a(0);
would theoretically cause the second call to a
to display the function's name as 'b'
(or vice versa). However, right now we only use the Function.name
syntax when throwing errors, so this isn't an issue at the present moment
Uses
Object.defineProperty
to set the correctfunction.name
value for aliased imports in:Did not do so for
interpreter/interpreter.ts
due to the deprecation note in #1476.How to test
Consider the following program:
Previously, this will result in the following error:
Now, it will result in:
Tested with: