Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 08 Apr 2013 11:33:21 -0400
changeset 1569 b65db6e9258f
parent 1568 6ddcd46bd552
child 1570 11d49104eea9
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Sun Apr 07 19:16:00 2013 -0700
+++ b/playground/jsonld.js	Mon Apr 08 11:33:21 2013 -0400
@@ -714,9 +714,33 @@
 /* WebIDL API */
 
 function JsonLdProcessor() {};
-JsonLdProcessor.prototype.expand = jsonld.expand;
-JsonLdProcessor.prototype.compact = jsonld.compact;
-JsonLdProcessor.prototype.flatten = jsonld.flatten;
+// callback param order unconventional w/WebIDL API
+JsonLdProcessor.prototype.expand = function(input, callback) {
+  var options = {};
+  if(arguments.length > 2) {
+    options = callback;
+    callback = arguments[2];
+  }
+  jsonld.expand(input, options, callback);
+};
+// callback param order unconventional w/WebIDL API
+JsonLdProcessor.prototype.compact = function(input, ctx, callback) {
+  var options = {};
+  if(arguments.length > 3) {
+    options = callback;
+    callback = arguments[3];
+  }
+  jsonld.compact(input, ctx, options, callback);
+};
+// callback param order unconventional w/WebIDL API
+JsonLdProcessor.prototype.flatten = function(input, ctx, callback) {
+  var options = {};
+  if(arguments.length > 3) {
+    options = callback;
+    callback = arguments[3];
+  }
+  jsonld.flatten(input, ctx, options, callback);
+};
 JsonLdProcessor.prototype.frame = jsonld.frame;
 JsonLdProcessor.prototype.fromRDF = jsonld.fromRDF;
 JsonLdProcessor.prototype.toRDF = jsonld.toRDF;