browser.js 596 B

1234567891011121314151617181920
  1. "use strict";
  2. exports["test common"] = require("./common")
  3. var Method = require("../core")
  4. exports["test host objects"] = function(assert) {
  5. var isElement = Method("is-element")
  6. isElement.define(function() { return false })
  7. isElement.define(Element, function() { return true })
  8. assert.notDeepEqual(typeof(Element.prototype[isElement]), "number",
  9. "Host object's prototype is extended with a number value")
  10. assert.ok(!isElement({}), "object is not an Element")
  11. assert.ok(document.createElement("div"), "Element is an element")
  12. }
  13. require("test").run(exports)