Re: API updated to use Futures - request for review

On Sunday, 5 May 2013 at 18:16, Markus Lanthaler wrote:  
> assert_equals: String(JsonLdProcessor.prototype) expected
> "[object JsonLdProcessorPrototype]" but got "[object JsonLdProcessor]"
>  
> Is there any way to pass this test with a JavaScript implementation?  
I think you might have implemented the JsonLdProcessor "interface object" incorrectly (in http://json-ld.org/playground/jsonld.js). It does not seem you implemented the "prototype" object part. See:
http://www.w3.org/TR/WebIDL/#interface-prototype-object

In particular, see the part about": "The class string of an interface prototype object is the concatenation of the interface’s identifier and the string “Prototype”."  

It might help to look at an implementation that exports an interface object as per WebIDL:
https://github.com/extensibleweb/webidl.js/blob/master/lib/interfaces/WebIDL.js

Note that it's impossible to fake the "native brand" of an object (i.e., you can never actually get it to report [object JsonLdProcessor] ) when testing, so a some point your tests will fail with a JS implementation that is intended to be a host object.  

However, that is OK, so long as the behaviour is identical. 

Received on Sunday, 5 May 2013 17:45:12 UTC