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
export function magicMethods (clazz) { | |
// A toggle switch for the __isset method | |
// Needed to control "prop in instance" inside of getters | |
let issetEnabled = true | |
const classHandler = Object.create(null) | |
// Trap for class instantiation | |
classHandler.construct = (target, args, receiver) => { | |
// Wrapped class instance |