Bug 166056 - Object.prototype.toString(m) !== '[object Module]'
Summary: Object.prototype.toString(m) !== '[object Module]'
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-20 05:36 PST by Guy Bedford
Modified: 2016-12-20 05:46 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Bedford 2016-12-20 05:36:09 PST
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.
Comment 1 Guy Bedford 2016-12-20 05:41:37 PST
Apologies - this works fine with `Object.prototype.toString.call(m)`... I missed the `call` here in my test! It works fine :)
Comment 2 Yusuke Suzuki 2016-12-20 05:46:53 PST
Ah, OK :)
No problem. Thank you for trying!