facebookarchive/prepack

Prepack emits code containing invalid global.TypedArray access

Open

#2,292 建立於 2018年7月18日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (14,268 star) (520 fork)batch import
bughelp wantedinterpreter

描述

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));

貢獻者指南

Prepack emits code containing invalid global.TypedArray access · facebookarchive/prepack#2292 | Good First Issue