--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -82,16 +82,17 @@ class ASTReader: private JS::AutoGCRoote
public:
ASTReader(JSContext* cx_, LifoAlloc& alloc_, const ReadOnlyCompileOptions& options)
: AutoGCRooter(cx_, BINPARSER)
, traceListHead(nullptr)
, allocator(cx_, alloc_)
, options_(options)
, cx(cx_)
, alloc(alloc_)
+ , currentDirectives_(/*strict*/false)
{ }
static bool test() {
// FIXME: Just a small hack to force the build system to
// display undefined symbols.
ASTReader foo(nullptr, *static_cast<LifoAlloc*>(nullptr), *static_cast<ReadOnlyCompileOptions*>(nullptr));
UniquePtr<ParseNode> out;
return foo.parse(nullptr, nullptr, nullptr, out);
@@ -146,26 +147,26 @@ private:
bool readString(SimpleTokenReader* reader, Maybe<std::string>&);
bool readString(SimpleTokenReader* reader, Maybe<std::u16string>&);
bool readString(SimpleTokenReader* reader, MutableHandleString);
bool readString(SimpleTokenReader* reader, MutableHandleAtom);
bool readString(SimpleTokenReader* reader, MutableHandle<PropertyName*>);
bool readBool(SimpleTokenReader* reader, Maybe<bool>&);
bool readNumber(SimpleTokenReader* reader, Maybe<double>&);
- const Directives& currentDirectives() const;
+ const Directives& currentDirectives() const {
+ return this->currentDirectives_;
+ }
ThisBinding thisBinding() const;
const ReadOnlyCompileOptions& options() const {
return this->options_;
}
// Names
-
-
// --- GC.
/* List of objects allocated during parsing, for GC tracing. */
ObjectBox* traceListHead;
void trace(JSTracer* trc)
{
ObjectBox::TraceList(trc, this->traceListHead);
}
@@ -212,16 +213,17 @@ private:
}
JS_DECLARE_NEW_METHODS(new_, allocParseNode, inline)
private:
const ReadOnlyCompileOptions& options_;
JSContext* cx;
LifoAlloc& alloc;
+ Directives currentDirectives_;
// Needs access to AutoGCRooter.
friend void TraceBinParser(JSTracer* trc, AutoGCRooter* parser);
};
class BinParseContext: public ParseContext {
public:
BinParseContext(ASTReader*, GlobalSharedContext*, Directives*);