Bug 166056
Summary: | Object.prototype.toString(m) !== '[object Module]' | ||
---|---|---|---|
Product: | WebKit | Reporter: | Guy Bedford <guybedford> |
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ysuzuki |
Priority: | P2 | ||
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Guy Bedford
In the module system, the `Symbol.toStringTag` on the module namespace object should be resulting in the following holding true:
```
import * as m from './m.js';
Object.prototype.toString(m) === '[object Module]';
```
But the above is currently returning `[object Object]` instead.
This is a useful feature for detecting if a given object is a module namespace object, which will likely be necessary for interop use cases in future.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Guy Bedford
Apologies - this works fine with `Object.prototype.toString.call(m)`... I missed the `call` here in my test! It works fine :)
Yusuke Suzuki
Ah, OK :)
No problem. Thank you for trying!