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

Support calling a method on an object. #160

Merged
merged 9 commits into from
Sep 8, 2021

Conversation

genevieve
Copy link
Collaborator

@genevieve genevieve commented Sep 1, 2021

An extension of #159 to fix #156

#159 (comment)

Builds on #162

object.go Show resolved Hide resolved
v8go.cc Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 1, 2021

Codecov Report

Merging #160 (aa2a8f5) into master (0eeb865) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
+ Coverage   96.99%   97.10%   +0.11%     
==========================================
  Files          12       12              
  Lines         466      484      +18     
==========================================
+ Hits          452      470      +18     
  Misses          9        9              
  Partials        5        5              
Impacted Files Coverage Δ
function.go 100.00% <100.00%> (ø)
object.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 0eeb865...aa2a8f5. Read the comment docs.

@genevieve genevieve marked this pull request as ready for review September 2, 2021 18:27
v8go.cc Outdated Show resolved Hide resolved
v8go.cc Outdated Show resolved Hide resolved
@@ -26,7 +26,7 @@ func (fn *Function) Call(args ...Valuer) (*Value, error) {
argptr = (*C.ValuePtr)(unsafe.Pointer(&cArgs[0]))
}
fn.ctx.register()
rtn := C.FunctionCall(fn.ptr, C.int(len(args)), argptr)
rtn := C.FunctionCall(fn.ptr, fn.ctx.iso.undefined.ptr, C.int(len(args)), argptr)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little 😬

Genevieve L'Esperance added 3 commits September 8, 2021 10:19
- Besides verifying that the obj.Get returns the err properly, we also
  want to test that fnVal.AsFunction returns the err properly when
  something is not a function
object_test.go Outdated Show resolved Hide resolved
@dylanahsmith dylanahsmith merged commit 1c2cf24 into rogchap:master Sep 8, 2021
@dylanahsmith dylanahsmith deleted the gl-objmethodcall branch September 8, 2021 14:40
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.

Calling an instance method that uses this fails with undefined
2 participants