Skip to content
marcoscaceres edited this page Jan 18, 2013 · 5 revisions

Below is a template that can be copied for defining a new type. Just replace XXX for the type you want to define.

/*
COPY SECTION 3.X
*/

define(function(require) {
    'use strict';
    var IDLType = require('types/IDLType'),
        WebIDL = require('interfaces/WebIDL');

    WebIDL.XXX = function(value) {
        if (!(this instanceof WebIDL.XXX)) {
            return toXXX(value);
        }
        this.value = value;
    };

    /*
    COPY SECTION 4.X
    */
    function toXXX(V) {

    }

    WebIDL.XXX.prototype = new IDLType('XXX', toXX);
});
```

Clone this wiki locally