ForkedAbruptCompletion created with generator containing joinCondition (#2272)

Summary:
Release Notes: None

PR solved by hermanventer's recent PR, just adding another test case closer to the one in the issue.

Resolves #2248
Pull Request resolved: https://github.com/facebook/prepack/pull/2272

Differential Revision: D8938294

Pulled By: cblappert

fbshipit-source-id: 18e4fd3b8913400b98242eff06f011ed0140459b
This commit is contained in:
Chris Blappert 2018-07-20 12:06:53 -07:00 committed by Facebook Github Bot
parent 19272b5725
commit f80b4af956

View File

@ -0,0 +1,19 @@
function fn(str, start) {
var size = str.length;
var posA = 0;
if (start > 0) {
for (; start > 0 && posA < size; start--) {
posA += 1 + str.charCodeAt(posA);
}
if (posA >= size) {
return posA;
}
}
}
if (global.__optimize) __optimize(fn);
global.inspect = function() {
let res1 = fn("abcdef", 1);
return res1;
};