typeof(HTMLObjectElement instance) should return object not function

RESOLVED INVALID

Status

()

Core
DOM
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: SkyLined, Unassigned)

Tracking

({testcase})

44 Branch
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Created attachment 8719453 [details]
Show the result of typeof(HTMLObjectElement instance) in the console

The below HTML/JavaScript is expected to output "object" for the line containing "typeof o". It returns "function" instead.

<!DOCTYPE html>
<script>
  var o = document.createElement("object");
  console.log(o);
  console.log(Object.getPrototypeOf(o));
  console.log(typeof o);
</script>
(Reporter)

Updated

2 years ago
Keywords: crash
<https://tc39.github.io/ecma262/#sec-typeof-operator-runtime-semantics-evaluation> checks for [[Call]].

<http://heycam.github.io/webidl/#call> defines objects with legacy callers have [[Call]].

<https://html.spec.whatwg.org/multipage/#htmlobjectelement> defines that HTMLObjectElement has a legacy caller.

-> our behaviour is correct.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.