Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Given object X
Given type A
if X isa A, BUT X.m isnot A::m
then I am unhappy.
For example (classical):
class A { func one() { return 1 } }
class B : A { func one() { return 2 } }
X = new B()
X isa A (true)
X.one !== A::one (true)
--> I'm unhappy.
For example (prototypal):
class A { func one() { return 1 } }
X.prototype = A;
X.one = func() { return 2 }
X isa A (true since X.prototype === A)
x.one !== A.one (true)
--> I'm unhappy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment