Update idltest to match WebIDL in API spec
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 10 Apr 2013 10:39:53 +0200
changeset 1582 6ebd6c358c91
parent 1581 8bd749c874d6
child 1583 21ed5714ea8e
Update idltest to match WebIDL in API spec
test-suite/idltest/index.html
--- a/test-suite/idltest/index.html	Tue Apr 09 21:57:55 2013 +0200
+++ b/test-suite/idltest/index.html	Wed Apr 10 10:39:53 2013 +0200
@@ -28,12 +28,12 @@
 <pre id="idl">
 [Constructor]
 interface JsonLdProcessor {
+    void compact (JsonLdInput input, JsonLdContext context, JsonLdOptions options, JsonLdCallback callback);
+    void compact (JsonLdInput input, JsonLdContext context, JsonLdCallback callback);
+    void expand (JsonLdInput input, JsonLdOptions options, JsonLdCallback callback);
     void expand (JsonLdInput input, JsonLdCallback callback);
-    void expand (JsonLdInput input, JsonLdOptions? options, JsonLdCallback callback);
-    void compact (JsonLdInput input, JsonLdContext? context, JsonLdCallback callback);
-    void compact (JsonLdInput input, JsonLdContext? context, JsonLdOptions? options, JsonLdCallback callback);
+    void flatten (JsonLdInput input, JsonLdContext? context, JsonLdOptions options, JsonLdCallback callback);
     void flatten (JsonLdInput input, JsonLdContext? context, JsonLdCallback callback);
-    void flatten (JsonLdInput input, JsonLdContext? context, JsonLdOptions? options, JsonLdCallback callback);
 };
 
 typedef (object or object[] or DOMString) JsonLdInput;
@@ -43,19 +43,19 @@
 
 callback LoadContextCallback = void (DOMString url, ContextLoadedCallback callback);
 
-callback ContextLoadedCallback = void (JsonLdError error, DOMString url, DOMString context);
+callback ContextLoadedCallback = void (JsonLdError error, optional DOMString url, optional DOMString context);
 
 dictionary JsonLdOptions {
-    DOMString             base;
-    boolean               compactArrays = true;
-    LoadContextCallback   loadContext;
-    (object or DOMString) expandContext = null;
-    DOMString             processingMode = "json-ld-1.0";
+    DOMString              base;
+    boolean                compactArrays = true;
+    LoadContextCallback    loadContext;
+    (object? or DOMString) expandContext = null;
+    DOMString              processingMode = "json-ld-1.0";
 };
 
 dictionary JsonLdError {
     JsonLdErrorCode code;
-    DOMString?      message;
+    DOMString?      message = null;
 };
 
 enum JsonLdErrorCode {
@@ -101,8 +101,8 @@
 (function() {
   window.JsonLdProcessor = window.jsonld.JsonLdProcessor;
   window.processor = new JsonLdProcessor();
-  
-  // pass writable/enumerable tests  
+
+  // pass writable/enumerable tests
   if(Object.defineProperty) {
     Object.defineProperty(JsonLdProcessor, 'prototype', {
       writable: false,
@@ -113,7 +113,7 @@
       enumerable: false
     });
   }
-  
+
   // pass stringification tests
   var toString = Object.prototype.toString;
   Object.prototype.toString = function() {
@@ -125,7 +125,7 @@
     }
     return toString.apply(this, arguments);
   };
-  
+
   var idl_array = new IdlArray();
 
   //idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);