Commit 5aff34da authored by Tristan Cavelier's avatar Tristan Cavelier

Metadata object test bug - fixed

Test if an object is a native object (`var object = {};`) seams not to be a good
idea. The Firefox scratchpad seams to act differently with them.
parent 858c2f73
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
*/ */
function Metadata(metadata) { function Metadata(metadata) {
if (arguments.length > 0) { if (arguments.length > 0) {
if (typeof metadata !== 'object' || if (metadata === null || typeof metadata !== 'object' ||
Object.getPrototypeOf(metadata || []) !== Object.prototype) { Array.isArray(metadata)) {
throw new TypeError("Metadata(): Optional argument 1 is not an object"); throw new TypeError("Metadata(): Optional argument 1 is not an object");
} }
this._dict = metadata; this._dict = metadata;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment