Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28094] Polyfill for Node.js process does not return correct toString info

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2020-08-24T15:01:00.000+0000
Affected Version/sRelease 9.0.3
Fix Version/sRelease 9.2.0
Componentsn/a
LabelsNode.js, griffin-app, polyfill
ReporterBrenton House
AssigneeChristopher Williams
Created2020-08-22T22:09:44.000+0000
Updated2020-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}

Comments

  1. Brenton House 2020-08-22

    Created PR: https://github.com/appcelerator/titanium_mobile/pull/11942
  2. Ewan Harris 2020-08-24

    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)
  3. Brenton House 2020-08-24

    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
  4. Christopher Williams 2020-08-24

    That's funky syntax to get at the root problem (and errors on Node 10.x). You could just do process.toString()
  5. Brenton House 2020-08-24

    Are you talking about change for PR or for the 3rd party libraries we use?
  6. Christopher Williams 2020-08-24

    Merged to master, auto backport to 9_3_X
  7. Samir Mohammed 2020-09-08

    *Closing ticket*. Fix verified in SDK version 9.2.0.v20200908050955, and 9.3.0.v20200908051946. *Test and other information can be found at:*\https://github.com/appcelerator/titanium_mobile/pull/11942

JSON Source