[TIMOB-28094] Polyfill for Node.js process does not return correct toString info
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-08-24T15:01:00.000+0000 |
Affected Version/s | Release 9.0.3 |
Fix Version/s | Release 9.2.0 |
Components | n/a |
Labels | Node.js, griffin-app, polyfill |
Reporter | Brenton House |
Assignee | Christopher Williams |
Created | 2020-08-22T22:09:44.000+0000 |
Updated | 2020-09-08T16:53:16.000+0000 |
Description
When using some Node.js libraries, they check for valid process using something like
{noformat}
{}.toString.call(process)
{noformat}
It is expected that this would return:
{noformat}
[object process]
{noformat}
but instead it returns:
{noformat}
[object Object]
{noformat}
Created PR: https://github.com/appcelerator/titanium_mobile/pull/11942
This only appears to work for me in Node 14 below that it errors with a syntax error (just incase anyone tries to fully repro)
I don’t think I am running Node.js 14 but I will double check. I thought Symbol.toStringTag was introduced in Node 6. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
That's funky syntax to get at the root problem (and errors on Node 10.x). You could just do
process.toString()
Are you talking about change for PR or for the 3rd party libraries we use?
Merged to master, auto backport to 9_3_X
*Closing ticket*. Fix verified in SDK version
9.2.0.v20200908050955
, and9.3.0.v20200908051946
. *Test and other information can be found at:*\https://github.com/appcelerator/titanium_mobile/pull/11942