-
Notifications
You must be signed in to change notification settings - Fork 185
Conversation
|
||
// export({name: value}) | ||
if (typeof name == 'object') { | ||
for (var p in name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need a hasOwnProperty
check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if we expect to run in environments with Object.prototype extended with enumerable properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about export(new MyObject)
, that has enumerable properties on its prototype. Won't this then copy those over to the module? I'm not to sure it will only receive plain objects, is all.
(If you extend Object.prototype
I feel you should be on your own)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API is defined to take instances of Object only from transpiler outputs and is independent of user code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically - Object or Module.
This is now tested and working against Traceur at google/traceur-compiler#1957. |
Merged. |
Thanks Guy! Hopefully we can get the other transpiler implementors to move quickly. |
Possible implementation of #386 pending format testing.