Update to latest jsonld.js, pass all WebIDL tests.
authorDave Longley <dlongley@digitalbazaar.com>
Tue, 07 May 2013 09:58:54 -0400
changeset 1640 c88482343a48
parent 1639 27976489aa51
child 1641 f5ba6c83e92c
Update to latest jsonld.js, pass all WebIDL tests.
playground/jsonld.js
test-suite/idltest/index.html
--- a/playground/jsonld.js	Mon May 06 22:28:18 2013 -0700
+++ b/playground/jsonld.js	Tue May 07 09:58:54 2013 -0400
@@ -881,12 +881,27 @@
 
 /* WebIDL API */
 
-function JsonLdProcessor() {};
+function JsonLdProcessor() {}
 JsonLdProcessor.prototype = jsonld.futures();
 JsonLdProcessor.prototype.toString = function() {
-  return '[object JsonLdProcessor]';
+  if(this instanceof JsonLdProcessor) {
+    return '[object JsonLdProcessor]';
+  }
+  return '[object JsonLdProcessorPrototype]';
 };
 jsonld.JsonLdProcessor = JsonLdProcessor;
+if(Object.defineProperty) {
+  Object.defineProperty(JsonLdProcessor, 'prototype', {
+    writable: false,
+    enumerable: false
+  });
+  Object.defineProperty(JsonLdProcessor.prototype, 'constructor', {
+    writable: true,
+    enumerable: false,
+    configurable: true,
+    value: JsonLdProcessor
+  });
+}
 
 /* Utility API */
 
--- a/test-suite/idltest/index.html	Mon May 06 22:28:18 2013 -0700
+++ b/test-suite/idltest/index.html	Tue May 07 09:58:54 2013 -0400
@@ -104,16 +104,6 @@
       configurable: true,
       value: window.jsonld.JsonLdProcessor
     });
-    Object.defineProperty(JsonLdProcessor, 'prototype', {
-      writable: false,
-      enumerable: false
-    });
-    Object.defineProperty(JsonLdProcessor.prototype, 'constructor', {
-      writable: true,
-      enumerable: false,
-      configurable: true,
-      value: JsonLdProcessor
-    });
   }
 
   // Ensure that stringification tests are passed