mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-10-05 19:07:43 +03:00
Summary: https://github.com/facebook/prepack/issues/2090 doesn't reproduce for me anymore so I'm adding a test. Pull Request resolved: https://github.com/facebook/prepack/pull/2281 Differential Revision: D8893196 Pulled By: gaearon fbshipit-source-id: c0d9748e5898ab8cffa0c6c23dd5db9dadfbf6cc
This commit is contained in:
parent
6cdf42f9e1
commit
3bf79dd693
@ -0,0 +1,35 @@
|
||||
(function() {
|
||||
function fn(arg) {
|
||||
if (arg.foo) {
|
||||
return "a";
|
||||
}
|
||||
if (arg.bar === 0) {
|
||||
return "b";
|
||||
}
|
||||
return Object.assign(
|
||||
{
|
||||
qux: function() {
|
||||
arg.qux();
|
||||
},
|
||||
},
|
||||
arg.baz()
|
||||
);
|
||||
}
|
||||
|
||||
if (global.__optimize) {
|
||||
__optimize(fn);
|
||||
}
|
||||
|
||||
global.inspect = function() {
|
||||
return JSON.stringify([
|
||||
fn({ foo: 1 }),
|
||||
fn({ bar: 0 }),
|
||||
fn({ foo: 1, bar: 0 }),
|
||||
fn({
|
||||
baz: function() {
|
||||
return { a: 42 };
|
||||
},
|
||||
}),
|
||||
]);
|
||||
};
|
||||
})();
|
Loading…
Reference in New Issue
Block a user