--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -364,17 +364,17 @@ ASTReader::parseScope(SimpleTokenReader*
bool
ASTReader::parseBlockStatementAux(SimpleTokenReader* reader,
const BinKind name,
const SimpleTokenReader::BinFields& fields,
UniquePtr<ParseNode>& out)
{
UniquePtr<ParseNode> body;
- UniquePtr<ParseNode> directives;
+ UniquePtr<ParseNode> directives; // Ignored
ScopeData scope(this->cx);
for (auto field: fields) {
switch (field) {
case BinField::binjs_scope:
if (!this->parseScope(reader, scope)) {
return false;
}
@@ -2204,16 +2204,39 @@ ASTReader::parseExpressionAux(SimpleToke
default:
return this->raiseError();
}
return true;
}
bool
+ASTReader::parseDirectiveList(SimpleTokenReader* reader, UniquePtr<ParseNode>& out) {
+ if (out) {
+ return this->raiseError();
+ }
+
+ uint32_t length;
+ SimpleTokenReader sub(this->cx);
+ if (!reader->readList(&length, &sub)) {
+ return false;
+ }
+
+ for (uint32_t i = 0; i < length; ++i) {
+ std::string string;
+ if (!this->readString(&sub, string)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+bool
ASTReader::readNumber(SimpleTokenReader* reader, Maybe<double>& out) {
if (out) {
return this->raiseError();
}
return reader->readMaybeF64(&out);
}