Last active
October 19, 2015 17:05
-
-
Save AaronAsAChimp/354374a7e1cdc68c4d9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class ExtendedArray extends Float64Array { | |
double () {} | |
} | |
while (true) { | |
let thing = new ExtendedArray(1); | |
console.log('The method "double" is', typeof thing.double); | |
console.log('Is it still an ExtendedArray?', thing instanceof ExtendedArray); | |
console.log('Is it still an Float64Array?', thing instanceof Float64Array); | |
if (thing.double === undefined) { | |
throw new Error('Method "double" should not be undefined'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment