From 4a61b87b37dd1380c294c1925401c029bc064627 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Mon, 30 Jul 2018 19:10:54 +0900 Subject: [PATCH] Bug 1479076 - Add LazyScript::maybeCompartment. r=jonco --- js/src/jit-test/tests/auto-regress/bug1479076.js | 6 ++++++ js/src/vm/JSScript.h | 1 + 2 files changed, 7 insertions(+) create mode 100644 js/src/jit-test/tests/auto-regress/bug1479076.js diff --git a/js/src/jit-test/tests/auto-regress/bug1479076.js b/js/src/jit-test/tests/auto-regress/bug1479076.js new file mode 100644 index 000000000000..2313d759e890 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1479076.js @@ -0,0 +1,6 @@ +fullcompartmentchecks(true); +var dbg = new Debugger(); +var g = newGlobal(); +g.eval("function f(){}"); +dbg.addDebuggee(g); +dbg.findScripts(); diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 45851b511add..ec5d8e0bb07e 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -2351,6 +2351,7 @@ class LazyScript : public gc::TenuredCell } JS::Compartment* compartment() const; + JS::Compartment* maybeCompartment() const { return compartment(); } Realm* realm() const; void initScript(JSScript* script);