Bug 1434305 - Part 1: Add LazyScript::{compartment,realm} which returns corresponding JSFunction's {compartment,realm}. r=jimb

This is a preparation for functions added in later parts, to handle LazyScript
samely as JSScript in template function etc.
This commit is contained in:
Tooru Fujisawa 2018-07-26 12:36:16 +09:00
Родитель 585bfee6dc
Коммит 09bde9007c
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -4247,6 +4247,18 @@ LazyScript::initScript(JSScript* script)
script_.set(script);
}
JS::Compartment*
LazyScript::compartment() const
{
return function_->compartment();
}
Realm*
LazyScript::realm() const
{
return function_->realm();
}
void
LazyScript::setEnclosingLazyScript(LazyScript* enclosingLazyScript)
{

Просмотреть файл

@ -2346,6 +2346,9 @@ class LazyScript : public gc::TenuredCell
return function_;
}
JS::Compartment* compartment() const;
Realm* realm() const;
void initScript(JSScript* script);
JSScript* maybeScript() {