Open bluesign opened 1 year ago
Minimal test case:
export const brokenArgsRest = async (...props) => { await someAsyncFunction(async () => { console.log(props) }) } export const someAsyncFunction = async callback => { await callback() }
generates
var brokenArgsRest = function brokenArgsRest() { return Promise.resolve(someAsyncFunction(function () { try { var _arguments2 = arguments; console.log([].slice.call(_arguments2)); return Promise.resolve(); } catch (e) { return Promise.reject(e); } })).then(function () {}); }; var someAsyncFunction = function someAsyncFunction(callback) { try { return Promise.resolve(callback()).then(function () {}); } catch (e) { return Promise.reject(e); } };
var _arguments2 = arguments; should be one more level up
var _arguments2 = arguments;
Context: We hit this bug on fcl-js lib : https://github.com/onflow/flow-js-testing/issues/182
PS: my js knowledge is limited, but seems related to inlining somehow.
Minimal test case:
generates
var _arguments2 = arguments;
should be one more level upContext: We hit this bug on fcl-js lib : https://github.com/onflow/flow-js-testing/issues/182
PS: my js knowledge is limited, but seems related to inlining somehow.