Skip to content

Loading…

Instanceof not working with classes #4

Merged
merged 1 commit into from

2 participants

@TobiaszCudnik

Instanceof not working with contracted classes, because Proxy doesn't receive a correct prototype.

@disnet disnet merged commit 105ec1b into disnet:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/contracts.coffee
View
3 src/contracts.coffee
@@ -615,7 +615,8 @@ object = (objContract, options = {}, name) ->
new bf()
)
else
- op = Proxy.create(handler, Object::)
+ proto = obj?.constructor?.prototype or Object::
+ op = Proxy.create(handler, proto)
unproxy.set op, this
op
)
Something went wrong with that request. Please try again.