2 function setupObjectHooks(hooks
)
4 // Wrapper for these object should be materialized before setting hooks.
7 HTMLSpanElement
.prototype;
9 Object
.defineProperty(Object
.prototype, "prototype", {
10 get: function() { return hooks
.prototypeGet(); },
11 set: function(value
) { return hooks
.prototypeSet(value
); }
14 Object
.defineProperty(Object
.prototype, "constructor", {
15 get: function() { return hooks
.constructorGet(); },
16 set: function(value
) { return hooks
.constructorSet(value
); }
22 function exerciseDocumentRegister()
25 register('x-b', {prototype: Object
.create(HTMLElement
.prototype)});
28 function register(name
, options
)
30 var myConstructor
= null;
32 myConstructor
= document
.registerElement(name
, options
);
37 debug("Constructor object isn't created.");
41 if (options
.prototype !== undefined && myConstructor
.prototype != options
.prototype) {
42 console
.log("FAIL: bad prototype");
46 var element
= new myConstructor();
49 if (element
.constructor != myConstructor
) {
50 console
.log("FAIL: bad constructor");
53 } catch (e
) { console
.log(e
); }