dop251 / goja

ECMAScript/JavaScript engine in pure Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@babel/helpers - typeof doesn't work

Pospelove opened this issue · comments

https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers/typeof.js

TypeError: Cannot assign to read only property '_typeof' at _typeof

Babel is configured to emit ES5

Hi. Could you please provide a reproducible test case?

Hey @dop251

function _typeof(obj) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
    return typeof obj;
  } : function (obj) {
    return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  }, _typeof(obj);
}

_typeof({});

The code runs fine for me.

probably fixed in master. i'm not sure about goja ver since use indirectly. closing for now. thanks for your time!