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

importcpp, importjs should allow accessing individual params in pattern #16605

Open
timotheecour opened this issue Jan 6, 2021 · 2 comments
Open

Comments

@timotheecour
Copy link
Member

timotheecour commented Jan 6, 2021

Example

this works:

func wrapToInt*(this: JsBigInt; bits: Natural): JsBigInt {.importjs:
  "(() => { const i = #, b = #; return BigInt.asIntN(b, i) })()".}

this doesn't work but should:
(EDIT)

func wrapToInt*(this: JsBigInt; bits: Natural): JsBigInt {.importjs: "BigInt.asIntN($3, $2)".}

(or at least something equivalently simple)
Note: $1 is for function name, so I'm starting at $2

Additional Information

devel 1.5.1 d2f4f25
related: timotheecour#488
related but different: #12150

@juancarlospaco
Copy link
Collaborator

You can not use $1 for arguments because thats the function name.

@timotheecour
Copy link
Member Author

indeed; I updated the issue accordingly

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

No branches or pull requests

2 participants