prepack
prepack copied to clipboard
A JavaScript bundle optimizer.
Prepacking this... ```js (function () { function f(g) { let x = 23; function f() { return x; } g(f); // g()); } })(); ``` results in the following (at...
```js (function () { var key = __abstract('string', '("y")'); function Foo() { } Foo.prototype.x = function() { }; var obj = new Foo(); obj[key] = 123; result = typeof obj.x...
Take the case: ```js function fn(attachment) { for ( var _iterator = attachment.style_list, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[ typeof Symbol === "function"...
We currently issue new PPxxxx numbers ad hoc, and maintain wiki pages for them. This is problematic for a number of reasons: - Wiki pages cannot be edited by the...
Prepacking the following crashes Prepack. ```js __evaluatePureFunction("boo"); ``` In the implementation, it shouldn't check via an `invariant` that the argument is a proper value, but instead it should throw a...
This crashes Prepack. The issue that binding assignments don't have to happen in optimized functions. ```js let g = __abstract("function", "(obj)"); global.result = __evaluatePureFunction(() => { let x = 23;...
In the code, look for a comment `// TODO #1615` to find the issue. The issue that `modifiedBindings` can refer to `FunctionEnvironmentRecord` which has a `$FunctionObject` that is also in...
We have the following test case. ```js (function() { function f(g) { let x = 23; function incrementX() { x = x + 42; } global.__optimize && __optimize(incrementX); g(incrementX); return...
Since #2362, we allow for multiple source maps to be given. However, we also require that the basenames of source file and source map file match. So, instead or in...
```js var c = __abstract('boolean', 'c'); var x = {foo:1}; if (c) x.bar = 2; result2 = Object.getOwnPropertyDescriptor(x, 'bar'); var y = __abstract({foo:1}, 'y'); __makeSimple(y); if (c) y.bar = 2;...