Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Problem validating a WebIDL that uses 'object' as an attribute name. #2

Closed
philipfennell opened this Issue · 2 comments

2 participants

@philipfennell

The following WebIDL fragment, when validated using the W3C's WebIDL checker generates an error:

[NoInterfaceObject]
interface Triple {
    readonly attribute RDFNode subject;
    readonly attribute RDFNode predicate;
    readonly attribute RDFNode object;

    stringifier DOMString toString ();
    boolean               equals (Triple otherTriple);
};

Results of checking .

The following errors were found in the extracted WebIDLs:

at 'object': expected identifier

If I change the 'object' attribute's name to something other than 'object', e.g. 'smobject' the problem goes away.

I have only recently started looking at WebIDL so I don't know if this is a problem with the definition or the validator. Is 'object' a reserved keyword?

@dontcallmedom

Hi Philip,

Yes, object is a reserved keyword (see http://dev.w3.org/2006/webapi/WebIDL/#idl-names)

You need to "escape" it with _ if you want to use that name.

HTH,
Dom

@philipfennell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.