-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
fbc42c1
to
e7e17fb
Compare
6e1c766
to
e8c4d2b
Compare
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little 😬
- 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
aa8c097
to
c8cf319
Compare
- Add back test for methodcall on not-a-function
c8cf319
to
aa2a8f5
Compare
An extension of #159 to fix #156
#159 (comment)
Builds on #162