Last active
March 21, 2017 08:28
-
-
Save adamauckland/746e6dc38fe8c625df8294a63b1fa75d to your computer and use it in GitHub Desktop.
Testing renaming classes
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
class OriginalClass { | |
constructor () { | |
console.log(this); | |
} | |
} | |
var originalClass = new OriginalClass(); | |
// outputs: | |
// | |
// OriginalClass {} | |
Object.defineProperty(OriginalClass, 'name', { | |
value: 'ModifiedClass', | |
writable: true | |
}); | |
var a = new OriginalClass(); | |
// outputs: | |
// | |
// ModifiedClass {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this mean you can also do
new ModifiedClass()
?