31 - Extended Class Type Checks
by steen_hansen
HTML
<!DOCTYPE html><meta charset="utf-8" />
<title>31 Extended Class Type Checks</title>
<div id='js-div' style="width:63%; " >
<a href='https://github.com/steenhansen/type-czech' target="_blank" class='git-hub'>GitHub Package</a>
<div id='js-code'>the javascript</div>
</div>
<div id="the-explanation" style="width:37%" >
<div class='an-explantion'>31 - Extended Class Type Checks</div>
<div id='explanation-text'>
<br>
It is possible to get PRE and POST checking on class
objects that will be extended; both constructor functions and methods.
<br><br>
But the class declarations must be interleaved with the linking of
classes to TypeCzech. Classes must be linked to TypeCzech before
being extended because there is no hoisting for Classes.
<br><br>
As in the example to the left, calls to type_czech.linkUp() must
precede class extensions.
<pre>
class First {...}
/**/ First = type_czech.linkUp(First, ...)
class Last extends First{
/**/ Last = type_czech.linkUp(Last, ...)
class Full extends Last {...}
/**/ Full = type_czech.linkUp(Full...)
</pre>
The ordering and depth of executions is recorded in the console to
highlight the different stages and states.
<br><br>
</div>
<div id="console-log" >
<div class='a-title'>Console Output</div>
<div id='log-text'></div>
<br>
</div>
<!-- -------------TYPE 1----------------------------- -->
<script src="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/consolelog.js"></script>
<script src="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/TypeCzech.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/type-czech.css">
<!-- --------------TYPE 1---------------------------- -->
<div id='js-fiddles'>
<a title="Example-Contents" href="https://jsfiddle.net/steen_hansen/1Lshcept/?Example-Contents" target="_blank">Contents</a>
...