[heycam/webidl] Propagate active script to callbacks (#902)

See discussion in https://github.com/tc39/ecma262/pull/2086#issuecomment-656257061.

This ensures that in cases like

```html
<!-- index.html -->
<script src="sub/path/foo.js"></script>
```

```js
// sub/path/foo.js
setTimeout(eval, 0, 'import(`./example.mjs`)');
```

the resulting imported module is `sub/path/example.mjs`, and not `example.mjs`. I.e. it ensures that `import()` resolves relative to the active script, even when it is being called via a Web IDL callback.

I will write web platform tests for this too.

/cc @hiroshige-g as he was involved in very similar discussions for cases like `` setTimeout("import(`./example.mjs`)") `` and @yuki3 as the Chromium binding person working on incumbents.
You can view, comment on, or merge this pull request online at:

  https://github.com/heycam/webidl/pull/902

-- Commit Summary --

  * Propagate active script to callbacks

-- File Changes --

    M index.bs (80)

-- Patch Links --

https://github.com/heycam/webidl/pull/902.patch
https://github.com/heycam/webidl/pull/902.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/902

Received on Thursday, 9 July 2020 18:06:22 UTC