vardcl=require("dcl/debug");varA=dcl({declaredClass:"A",m:42// not a function});varB=dcl(A,{declaredClass:"B",m:dcl.superCall(function(sup){returnsup?sup.call(this):0;})});// At this point dcl.SuperError will be thrown.
You will see the following exception:
1
dcl: super call error in B, while weaving B, method m (value) wrong arg
Wrong supercalling method
Wrong supercalling method
12345678
vardcl=require("dcl/debug");varA=dcl({declaredClass:"A",m:dcl.superCall("Should be a function, but it is a string.")});// At this point dcl.SuperError will be thrown.
You will see the following exception:
1
dcl: super call error in A, while weaving A, method m (value) wrong call
Wrong result
Wrong result
12345678910
vardcl=require("dcl/debug");varA=dcl({declaredClass:"A",m:dcl.superCall(function(sup){return"Instead of a function I return a string.";})});// At this point dcl.SuperError will be thrown.
You will see the following exception:
1
dcl: super call error in A, while weaving A, method m (value) wrong result
Wrong supercalling getter
Wrong supercalling method
12345678910
vardcl=require("dcl/debug");varA=dcl({declaredClass:"A",m:dcl.prop({get:dcl.superCall("Should be a function, but it is a string.")})});// At this point dcl.SuperError will be thrown.
You will see the following exception:
1
dcl: super call error in A, while weaving A, method m (get) wrong call
Wrong object super
Wrong super
12345678910
vardcl=require("dcl/debug"),advise=require("dcl/advise");vara={m:42};advise.around(a,"m",function(sup){returnfunction(){return33;};});// At this point dcl.SuperError will be thrown.
You will see the following exception:
1
dcl: super call error in object of UNNAMED, while weaving method m (value) wrong arg