tools/1to2.js fails to generate proper source
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 531
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
I'm using NAN-1 with https://github.com/Gottox/child_pty. In https://github.com/Gottox/child_pty/issues/7 it came up, that NAN-2 breaks the build process.
I tried to use the 1to2.js script, but it generates wrong constructs, such as:
- if(obj->Has(columns))
- w->ws_col = obj->Get(columns)->Uint32Value();
- if(obj->Has(rows))
- w->ws_row = obj->Get(rows)->Uint32Value();
+ NanHas(if(obj, columns))
+ w->ws_col = NanGet(obj, columns)->Uint32Value();
+ NanHas(if(obj, rows))
+ w->ws_row = NanGet(obj, rows)->Uint32Value();
Furthermore, I'd really like to have a comprehensive migration guide. (https://github.com/nodejs/nan/issues/402)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tools/1to2.js and reproduce the conversion using the NAN-1 example shown in the issue. Check that Has and Get expressions preserve the object and property arguments without inserting if into NanHas; the generated source should match the intended NAN-2 constructs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript, node.js
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100