coffeescript icon indicating copy to clipboard operation
coffeescript copied to clipboard

Embeded JS can override reserved names like __extends, __hasProp, etc.

Open OnesimusUnbound opened this issue 14 years ago • 2 comments

x = 1 # to force embebded js after the declaration of __extends
`__extends = function(){}` # breaks __extends functionality
class S extends Array

console.log (new S).push.toString()

This is an edge case, though I don't think it will hurt to report this. Moreover, checking the embeded JS for overriding CS specific reserve words is an over kill.

Anyway, do you think this should be documented?

OnesimusUnbound avatar Jul 03 '12 08:07 OnesimusUnbound

Embedded JS shouldn't be used.

goto-bus-stop avatar Jul 05 '12 17:07 goto-bus-stop

No.

michaelficarra avatar Jul 05 '12 18:07 michaelficarra