Allen Wirfs-Brock (2014-02-20T20:31:14.000Z)
On Feb 20, 2014, at 11:47 AM, Guy Bedford wrote:

> If Module objects are not classes, then what would be the recommended way to detect if a given object is a Module?
> 
> Would there be a unique toString output?

Can't.  'toString' might be a binding exported by a module so a module object can have its own toString method (or any other non export properties).

However, I've been think that it may be reasonable for Object.prototype.toString to have special case handling of Module objects.  eg:
Object.prototype.toString.call(someModule) // "[object Module]"

But, what's you use case?  Other than for debugging output, when would you need to check in an arbitrary object is a Module object?

Allen




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140220/ce84aaba/attachment.html>
domenic at domenicdenicola.com (2014-02-24T21:33:05.287Z)
Can't.  'toString' might be a binding exported by a module so a module object can have its own toString method (or any other non export properties).

However, I've been think that it may be reasonable for Object.prototype.toString to have special case handling of Module objects.  eg:

```js
Object.prototype.toString.call(someModule) // "[object Module]"
```

But, what's you use case?  Other than for debugging output, when would you need to check in an arbitrary object is a Module object?