cesanta / v7

Embedded JavaScript engine for C/C++
Other
1.43k stars 177 forks source link

Please implement Function.prototype.call() #549

Closed realzeus closed 8 years ago

realzeus commented 8 years ago

This is very similar to Function.prototype.apply()

The call() method calls a function with a given this value and arguments provided individually. The apply() method calls a function with a given this value and arguments provided as an array.

See call() and apply()

mkmik commented 8 years ago

call is implemented, see: https://github.com/cesanta/v7/blob/39d1ca7/v7.c#L24474

The build is guarded by V7_ENABLE__Function__call, which is enabled in the full build profile.

However https://github.com/smartjs doesn't have that flag enabled. I'll add it, now that stdlib is cheap; but it's not a V7 issue.

mkmik commented 8 years ago

@realzeus FYI, Function.prototype.call enabled in ESP8266 SJS build since: https://github.com/cesanta/smart.js/commit/09e12b66eb9e6d3220dab890d838f7158bf311d7