Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between Node and Trireme (function.call()) #157

Open
dzhivushko opened this issue Jun 27, 2017 · 0 comments
Open

Difference between Node and Trireme (function.call()) #157

dzhivushko opened this issue Jun 27, 2017 · 0 comments

Comments

@dzhivushko
Copy link

dzhivushko commented Jun 27, 2017

we use Apigee (Trireme). I tested code below on my local Trireme installation and it works as described below.

Simple code: Object.prototype.toString.call(null)
Run using Node: [object Null]
Run using Trireme: [object Object]

I see the comment in MSD about usage of 'function.call(thisArg)':

thisArg
The value of this provided for the call to a function. Note that this may not be the actual value seen by the method: if the method is a function in non-strict mode , null and undefined will be replaced with the global object and primitive values will be converted to objects.

Setting 'use strict' doesn't change anything.
Some 3rd-party modules use such code and it doesn't work as expected if we run our project using Apigee.
Is it possible to fix it to have the same behavior as described for 'strict' mode to avoid replacement of null with object? Or did someone provide an explanation about this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant