The last refactroings leaking the '__GeneratorFunction()' into the properties of the globalThis object
@Test
public void todo() {
final String script =
"var all = [];" +
"for (var property in this) {" +
" if (typeof this[property] == 'function') {" +
" all.push(property + '()');" +
" } else {" +
" all.push(property);" +
" }" +
"}" +
"all.sort();" +
"all.join()";
Utils.runWithAllModes(
Utils.contextFactoryWithFeatures(),
cx -> {
TopLevel scope = cx.initSafeStandardObjects();
Object result = cx.evaluateString(scope, script, "test_script", 1, null);
assertEquals("__GeneratorFunction(),all,global,property", result); // this is wrong __GeneratorFunction() should not be visible here
return null;
});
}
The last refactroings leaking the '__GeneratorFunction()' into the properties of the globalThis object
(found while using the current head (277cf99) in HtmlUnit)
Test case: