1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00
TiddlyWiki5/boot
Felix Küppers f99a4e7664 Bugfix: Object.freeze() called on null
For five minutes I stared at the following code...

    if(value != null && typeof value === "object") {
      Object.freeze(value);
    }

... and at the error message that led me to this code: `Object.freeze called on non-object`

And then I remembered that js treads null as object (http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.3). This means the `typeof === "object"` will not discover null and freeze will throw an error...

So `value != null` will also work when value is undefined.

A hard to find bug ;)
2015-03-07 20:47:43 +01:00
..
boot.css.tid Rename "tw-error-*" classes to "tc-error-*" 2014-08-28 17:39:32 +01:00
boot.js Bugfix: Object.freeze() called on null 2015-03-07 20:47:43 +01:00
bootprefix.js Allow callers of the bootprefix to determine browser status 2015-01-11 14:21:31 +00:00
sjcl.js Make the core into a plugin 2013-03-28 17:07:30 +00:00
sjcl.js.meta Make the core into a plugin 2013-03-28 17:07:30 +00:00