Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Prepack emits code containing invalid global.TypedArray access #2292

Open
calebmer opened this issue Jul 18, 2018 · 0 comments
Open

Prepack emits code containing invalid global.TypedArray access #2292

calebmer opened this issue Jul 18, 2018 · 0 comments

Comments

@calebmer
Copy link
Contributor

TypedArray is a global not exposed to the user JavaScript runtime. Try global.TypedArray in your JavaScript environment of choice. We must emit Object.getPrototypeOf(Int8Array) or similar instead of TypedArray.

Input

var TypedArray = Object.getPrototypeOf(Int8Array);
console.log(TypedArray.from.name === "from");

Output

var TypedArray;
(function() {
  var _$0 = this;

  var _$1 = _$0.TypedArray; // <-------------------- `TypedArray` is not exposed on the global object!
  _$0.TypedArray = _$1;
  console.log(true);
}.call(this));
@calebmer calebmer changed the title Prepack emits code containing invalid global.TypedArray access Prepack emits code containing invalid global.TypedArray access Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants