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

Add Function.NewInstance to expose the corresponding V8 function #134

Merged
merged 3 commits into from
May 31, 2021

Conversation

dylanahsmith
Copy link
Collaborator

Problem

I was trying to do something like new Error(message) from Go code, but didn't see a way of using the javascript new operator.

Solution

It looks like v8::Function::NewInstance is the function we need for doing this, so I added a corresponding function to the v8go API.

@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #134 (dd357de) into master (b3de643) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   96.81%   96.90%   +0.08%     
==========================================
  Files          12       12              
  Lines         440      452      +12     
==========================================
+ Hits          426      438      +12     
  Misses          9        9              
  Partials        5        5              
Impacted Files Coverage Δ
context.go 94.59% <100.00%> (+0.22%) ⬆️
function.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3de643...dd357de. Read the comment docs.

@rogchap
Copy link
Owner

rogchap commented May 19, 2021

Hey @dylanahsmith
Thanks for this PR. Code looks good; would be good if we could raise the test coverage.
Could you also add an entry to the CHANGELOG.md?

@dylanahsmith
Copy link
Collaborator Author

I've added an extra test for the error case and a changelog entry. Looks like CI is awaiting approval to run

@rogchap rogchap merged commit d9a0b1b into rogchap:master May 31, 2021
@dylanahsmith dylanahsmith deleted the function-new-instance branch December 21, 2021 14:36
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

Successfully merging this pull request may close these issues.

2 participants