Skip to content

Conversation

@dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Sep 19, 2019

This PR implements typeof by emulating what JS/TS would do (see also). As such, it's not particularly accurate, for example

  • typeof null == "object" even though AS would compile a lone null without class context as usize
  • typeof SomeClassEnumOrNamespace == "object" even though that's not actually a runtime object in AS
  • typeof doesntEvenExist == "undefined" even though that's not a type in AS (ofc also true for object)
  • there's just "number"

plus

  • typeof someAnyref == "anyref" since MDN says "Host object (provided by the JS environment) - Implementation-dependent." Not sure if that applies here, though.

@dcodeIO dcodeIO merged commit f9e6ce7 into master Sep 20, 2019
@dcodeIO dcodeIO deleted the typeof branch November 8, 2019 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants