{"size": 992, "ext": "js", "max_stars_repo_path": "third_party/blink/web_tests/fast/js/script-tests/implicit-call-with-global-reentry.js", "max_stars_repo_name": "zealoussnow/chromium", "max_stars_repo_stars_event_min_datetime": "2015-01-01T01:57:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T23:33:32.000Z", "max_issues_repo_path": "third_party/blink/web_tests/fast/js/script-tests/implicit-call-with-global-reentry.js", "max_issues_repo_name": "zealoussnow/chromium", "max_issues_repo_issues_event_min_datetime": "2015-05-04T09:58:14.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-31T19:35:03.000Z", "max_forks_repo_path": "third_party/blink/web_tests/fast/js/script-tests/implicit-call-with-global-reentry.js", "max_forks_repo_name": "zealoussnow/chromium", "max_forks_repo_forks_event_min_datetime": "2015-01-02T11:32:21.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T16:35:46.000Z"}
{"max_stars_count": 14668, "max_issues_count": 113, "max_forks_count": 5941, "avg_line_length": 39.68, "max_line_length": 116, "alphanum_fraction": 0.6421370968}
description(
"This test checks that implicit reentry to global code through a getter does not clobber the calling register file."
);

var testVar = "FAIL";
function testGlobalCode(test) {
    document.write("<script>"+test+"<"+"/script>");
}
var testObject = {
    get getterTest(){ testGlobalCode("var a, b, c, d; testVar = 'PASS';"); },
    set setterTest(_){ testGlobalCode("var e, f, g, h; testVar = 'PASS';"); },
    toString: function() { testGlobalCode("var i, j, k, l; testVar = 'PASS';"); return ''; },
    valueOf: function() { testGlobalCode("var m, n, o, p; testVar = 'PASS';"); return 0; },
    toStringTest: function() { "" + this; },
    valueOfTest: function() { 0 * this; }
};

shouldBe("testObject.getterTest; testVar;", '"PASS"');
var testVar = "FAIL";
shouldBe("testObject.setterTest = 1; testVar;", '"PASS"');
var testVar = "FAIL";
shouldBe("testObject.toStringTest(); testVar;", '"PASS"');
var testVar = "FAIL";
shouldBe("testObject.valueOfTest(); testVar;", '"PASS"');
