W3C home > Mailing lists > Public > public-rdf-comments@w3.org > May 2013

Re: API updated to use Futures - request for review

From: Marcos Caceres <w3c@marcosc.com>
Date: Sun, 5 May 2013 18:44:41 +0100
To: Markus Lanthaler <markus.lanthaler@gmx.net>
Cc: public-script-coord@w3.org, public-rdf-comments@w3.org
Message-ID: <4D866635360948A1AFA0C89135256CFD@marcosc.com>

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:56 UTC