Last active
August 11, 2023 13:50
-
-
Save anttikuuskoski/08c246aba218d74f65c752d55f836dae to your computer and use it in GitHub Desktop.
Code to demonstrate a bug in Object.create in Shelly gen 2 firmware version 1.0.0-beta6.
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
// Code to demonstrate a bug in Object.create in Shelly gen 2 firmware version 1.0.0-beta6 in a Shelly Plus Plug S | |
let original = { | |
key: 'value' | |
}; | |
// Make a clone | |
let clone = Object.create(original); | |
// Should print the original object stringified and it does | |
console.log("", JSON.stringify(original)); // {"key":"value"} | |
// Should print an object equal to the original. !!! Does not, instead prints an empty object. | |
console.log("", JSON.stringify(clone)); // {} | |
// If clone was really empty, should not print anything. Instead, | |
// prints value (as expected if not for the previous fail). Note: no quotes! | |
console.log("", clone.key); // value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment