[test] Wrap combined tests with a realm on gc fuzzer

Without realm-eval, the toplevel references in loaded tests are not
garbage-collected and changes in the tests can affect the global
object.

TBR=ulan@chromium.org
NOTRY=true

Bug: v8:7379, v8:7376
Change-Id: Id4d451e38fe49c6531a07d541ad3c67298b6acf2
Reviewed-on: https://chromium-review.googlesource.com/890519
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50915}
This commit is contained in:
Michael Achenbach 2018-01-27 15:33:02 +01:00 committed by Commit Bot
parent 6ecd970226
commit 399101df1d

View File

@ -14,10 +14,12 @@ for (let jstest of arguments) {
// anonymous function to not populate global namespace.
(function () {
let realm = Realm.create();
try {
load(jstest);
Realm.eval(realm, "load(\"" + jstest + "\");");
} catch (err) {
// ignore all errors
}
Realm.dispose(realm);
})();
}