--- a/js/src/frontend/BinSource-auto.cpp
+++ b/js/src/frontend/BinSource-auto.cpp
@@ -2352,17 +2352,17 @@ BinASTParser<Tok>::parseInterfaceAsserte
{
MOZ_ASSERT(kind == BinKind::AssertedBlockScope);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::LexicallyDeclaredNames, BinField::CapturedNames, BinField::HasDirectEval }));
MOZ_TRY(parseAndUpdateScopeNames(*parseContext_->innermostScope(), DeclarationKind::Let));
MOZ_TRY(parseAndUpdateCapturedNames());
- MOZ_TRY_DECL(hasDirectEval, readBool());
+ MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
if (hasDirectEval) {
parseContext_->sc()->setHasDirectEval();
parseContext_->sc()->setBindingsAccessedDynamically();
}
if (hasDirectEval && parseContext_->isFunctionBox() && !parseContext_->sc()->strict()) {
// In non-strict mode code, direct calls to eval can
// add variables to the call object.
@@ -2400,17 +2400,17 @@ BinASTParser<Tok>::parseInterfaceAsserte
{
MOZ_ASSERT(kind == BinKind::AssertedParameterScope);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::ParameterNames, BinField::CapturedNames, BinField::HasDirectEval }));
MOZ_TRY(parseAndUpdateScopeNames(parseContext_->functionScope(), DeclarationKind:: PositionalFormalParameter));
MOZ_TRY(parseAndUpdateCapturedNames());
- MOZ_TRY_DECL(hasDirectEval, readBool());
+ MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
if (hasDirectEval) {
parseContext_->sc()->setHasDirectEval();
parseContext_->sc()->setBindingsAccessedDynamically();
}
if (hasDirectEval && parseContext_->isFunctionBox() && !parseContext_->sc()->strict()) {
// In non-strict mode code, direct calls to eval can
// add variables to the call object.
@@ -2450,17 +2450,17 @@ BinASTParser<Tok>::parseInterfaceAsserte
MOZ_ASSERT(kind == BinKind::AssertedVarScope);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::LexicallyDeclaredNames, BinField::VarDeclaredNames, BinField::CapturedNames, BinField::HasDirectEval }));
MOZ_TRY(parseAndUpdateScopeNames(*parseContext_->innermostScope(), DeclarationKind::Let));
MOZ_TRY(parseAndUpdateScopeNames(parseContext_->varScope(), DeclarationKind::Var));
MOZ_TRY(parseAndUpdateCapturedNames());
- MOZ_TRY_DECL(hasDirectEval, readBool());
+ MOZ_TRY_DECL(hasDirectEval, tokenizer_->readBool());
if (hasDirectEval) {
parseContext_->sc()->setHasDirectEval();
parseContext_->sc()->setBindingsAccessedDynamically();
}
if (hasDirectEval && parseContext_->isFunctionBox() && !parseContext_->sc()->strict()) {
// In non-strict mode code, direct calls to eval can
// add variables to the call object.
@@ -2531,17 +2531,17 @@ BinASTParser<Tok>::parseAssignmentTarget
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceAssignmentTargetIdentifier(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::AssignmentTargetIdentifier);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Name }));
RootedAtom name((cx_));
- MOZ_TRY(readString(&name));
+ MOZ_TRY_VAR(name, tokenizer_->readAtom());
if (!IsIdentifier(name))
return raiseError("Invalid identifier");
TRY_DECL(result, factory_.newName(name->asPropertyName(), tokenizer_->pos(start), cx_));return result;
}
/*
@@ -2816,17 +2816,17 @@ BinASTParser<Tok>::parseBindingIdentifie
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceBindingIdentifier(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::BindingIdentifier);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Name }));
RootedAtom name((cx_));
- MOZ_TRY(readString(&name));
+ MOZ_TRY_VAR(name, tokenizer_->readAtom());
if (!IsIdentifier(name))
return raiseError("Invalid identifier");
TRY_DECL(result, factory_.newName(name->asPropertyName(), tokenizer_->pos(start), cx_));return result;
}
/*
@@ -2981,22 +2981,22 @@ BinASTParser<Tok>::parseBreakStatement()
}
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceBreakStatement(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::BreakStatement);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Label }));
RootedAtom label(cx_);
- MOZ_TRY(readMaybeString(&label));
-
- if (label && !IsIdentifier(label))
- return raiseError("Invalid identifier");
+ MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
if (label) {
+ if (!IsIdentifier(label))
+ return raiseError("Invalid identifier");
+
auto validity = parseContext_->checkBreakStatement(label->asPropertyName());
if (validity.isErr()) {
switch (validity.unwrapErr()) {
case ParseContext::BreakStatementError::ToughBreak:
return raiseError(kind, "Not in a loop");
case ParseContext::BreakStatementError::LabelNotFound:
return raiseError(kind, "Label not found");
@@ -3446,22 +3446,22 @@ BinASTParser<Tok>::parseContinueStatemen
}
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceContinueStatement(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::ContinueStatement);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Label }));
RootedAtom label(cx_);
- MOZ_TRY(readMaybeString(&label));
-
- if (label && !IsIdentifier(label))
- return raiseError("ContinueStatement - Label MUST be an identifier");
+ MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
if (label) {
+ if (!IsIdentifier(label))
+ return raiseError("ContinueStatement - Label MUST be an identifier");
+
auto validity = parseContext_->checkContinueStatement(label ? label->asPropertyName() : nullptr);
if (validity.isErr()) {
switch (validity.unwrapErr()) {
case ParseContext::ContinueStatementError::NotInALoop:
return raiseError(kind, "Not in a loop");
case ParseContext::ContinueStatementError::LabelNotFound:
return raiseError(kind, "Label not found");
}
@@ -3563,17 +3563,17 @@ BinASTParser<Tok>::parseDirective()
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceDirective(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::Directive);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::RawValue }));
RootedAtom rawValue((cx_));
- MOZ_TRY(readString(&rawValue));
+ MOZ_TRY_VAR(rawValue, tokenizer_->readAtom());
TokenPos pos = tokenizer_->pos(start);
TRY_DECL(result, factory_.newStringLiteral(rawValue, pos));return result;
}
/*
interface DoWhileStatement : Node {
@@ -4173,20 +4173,20 @@ BinASTParser<Tok>::parseFunctionDeclarat
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceFunctionDeclaration(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::FunctionDeclaration);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::IsAsync, BinField::IsGenerator, BinField::ParameterScope, BinField::BodyScope, BinField::Name, BinField::Params, BinField::Body }));
- MOZ_TRY_DECL(isAsync, readBool());
-
-
- MOZ_TRY_DECL(isGenerator, readBool());
+ MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
+
+
+ MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
MOZ_TRY_DECL(funbox, buildFunctionBox(
isGenerator ? GeneratorKind::Generator
: GeneratorKind::NotGenerator,
isAsync ? FunctionAsyncKind::AsyncFunction
: FunctionAsyncKind::SyncFunction));
// Push a new ParseContext. It will be used to parse `scope`, the arguments, the function.
@@ -4248,20 +4248,20 @@ BinASTParser<Tok>::parseFunctionExpressi
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceFunctionExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::FunctionExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::IsAsync, BinField::IsGenerator, BinField::ParameterScope, BinField::BodyScope, BinField::Name, BinField::Params, BinField::Body }));
- MOZ_TRY_DECL(isAsync, readBool());
-
-
- MOZ_TRY_DECL(isGenerator, readBool());
+ MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
+
+
+ MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
MOZ_TRY_DECL(funbox, buildFunctionBox(
isGenerator ? GeneratorKind::Generator
: GeneratorKind::NotGenerator,
isAsync ? FunctionAsyncKind::AsyncFunction
: FunctionAsyncKind::SyncFunction));
// Push a new ParseContext. It will be used to parse `scope`, the arguments, the function.
@@ -4347,17 +4347,17 @@ BinASTParser<Tok>::parseIdentifierExpres
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceIdentifierExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::IdentifierExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Name }));
RootedAtom name((cx_));
- MOZ_TRY(readString(&name));
+ MOZ_TRY_VAR(name, tokenizer_->readAtom());
if (!IsIdentifier(name))
return raiseError("Invalid identifier");
TRY_DECL(result, factory_.newName(name->asPropertyName(), tokenizer_->pos(start), cx_));return result;
}
/*
@@ -4516,17 +4516,17 @@ BinASTParser<Tok>::parseLabelledStatemen
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLabelledStatement(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LabelledStatement);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Label, BinField::Body }));
RootedAtom label((cx_));
- MOZ_TRY(readString(&label));
+ MOZ_TRY_VAR(label, tokenizer_->readAtom());
if (!IsIdentifier(label))
return raiseError("Invalid identifier");
ParseContext::LabelStatement stmt(parseContext_, label);
MOZ_TRY_DECL(body, parseStatement());
TRY_DECL(result, factory_.newLabeledStatement(label->asPropertyName(), body, start));return result;
@@ -4556,17 +4556,17 @@ BinASTParser<Tok>::parseLiteralBooleanEx
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLiteralBooleanExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LiteralBooleanExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Value }));
- MOZ_TRY_DECL(value, readBool());
+ MOZ_TRY_DECL(value, tokenizer_->readBool());
TRY_DECL(result, factory_.newBooleanLiteral(value, tokenizer_->pos(start)));return result;
}
/*
interface LiteralInfinityExpression : Node {
}
@@ -4647,17 +4647,17 @@ BinASTParser<Tok>::parseLiteralNumericEx
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLiteralNumericExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LiteralNumericExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Value }));
- MOZ_TRY_DECL(value, readNumber());
+ MOZ_TRY_DECL(value, tokenizer_->readDouble());
TRY_DECL(result, factory_.newNumber(value, DecimalPoint::HasDecimal, tokenizer_->pos(start)));return result;
}
/*
interface LiteralPropertyName : Node {
string value;
@@ -4681,17 +4681,17 @@ BinASTParser<Tok>::parseLiteralPropertyN
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLiteralPropertyName(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LiteralPropertyName);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Value }));
RootedAtom value((cx_));
- MOZ_TRY(readString(&value));
+ MOZ_TRY_VAR(value, tokenizer_->readAtom());
ParseNode* result;
uint32_t index;
if (value->isIndex(&index))
TRY_VAR(result, factory_.newNumber(index, NoDecimal, TokenPos(start, tokenizer_->offset())));
else
TRY_VAR(result, factory_.newObjectLiteralPropertyName(value, tokenizer_->pos(start)));return result;
}
@@ -4721,34 +4721,40 @@ BinASTParser<Tok>::parseLiteralRegExpExp
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLiteralRegExpExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LiteralRegExpExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Pattern, BinField::Flags }));
RootedAtom pattern((cx_));
- MOZ_TRY(readString(&pattern));
- Chars flags(cx_);
- MOZ_TRY(readString(flags));
+ MOZ_TRY_VAR(pattern, tokenizer_->readAtom());
+ RootedAtom flags(cx_);
+ MOZ_TRY_VAR(flags, tokenizer_->readAtom());
RegExpFlag reflags = NoFlags;
- for (auto c : flags) {
- if (c == 'g' && !(reflags & GlobalFlag))
- reflags = RegExpFlag(reflags | GlobalFlag);
- else if (c == 'i' && !(reflags & IgnoreCaseFlag))
- reflags = RegExpFlag(reflags | IgnoreCaseFlag);
- else if (c == 'm' && !(reflags & MultilineFlag))
- reflags = RegExpFlag(reflags | MultilineFlag);
- else if (c == 'y' && !(reflags & StickyFlag))
- reflags = RegExpFlag(reflags | StickyFlag);
- else if (c == 'u' && !(reflags & UnicodeFlag))
- reflags = RegExpFlag(reflags | UnicodeFlag);
- else
- return raiseError("Invalid flags");
+ JSAutoByteString autoBytes;
+ const char* bytes = AtomToPrintableString(cx_, flags.get(), &autoBytes);
+
+ if (bytes) {
+ for (; *bytes != 0; ++bytes) {
+ const char c = *bytes;
+ if (c == 'g' && !(reflags & GlobalFlag))
+ reflags = RegExpFlag(reflags | GlobalFlag);
+ else if (c == 'i' && !(reflags & IgnoreCaseFlag))
+ reflags = RegExpFlag(reflags | IgnoreCaseFlag);
+ else if (c == 'm' && !(reflags & MultilineFlag))
+ reflags = RegExpFlag(reflags | MultilineFlag);
+ else if (c == 'y' && !(reflags & StickyFlag))
+ reflags = RegExpFlag(reflags | StickyFlag);
+ else if (c == 'u' && !(reflags & UnicodeFlag))
+ reflags = RegExpFlag(reflags | UnicodeFlag);
+ else
+ return raiseError("Invalid flags");
+ }
}
Rooted<RegExpObject*> reobj(cx_);
TRY_VAR(reobj, RegExpObject::create(cx_,
pattern,
reflags,
alloc_,
@@ -4781,17 +4787,17 @@ BinASTParser<Tok>::parseLiteralStringExp
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceLiteralStringExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::LiteralStringExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Value }));
RootedAtom value((cx_));
- MOZ_TRY(readString(&value));
+ MOZ_TRY_VAR(value, tokenizer_->readAtom());
TRY_DECL(result, factory_.newStringLiteral(value, tokenizer_->pos(start)));return result;
}
/*
interface Method : Node {
bool isAsync;
@@ -4821,20 +4827,20 @@ BinASTParser<Tok>::parseMethod()
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceMethod(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::Method);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::IsAsync, BinField::IsGenerator, BinField::ParameterScope, BinField::BodyScope, BinField::Name, BinField::Params, BinField::Body }));
- MOZ_TRY_DECL(isAsync, readBool());
-
-
- MOZ_TRY_DECL(isGenerator, readBool());
+ MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
+
+
+ MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
MOZ_TRY_DECL(funbox, buildFunctionBox(
isGenerator ? GeneratorKind::Generator
: GeneratorKind::NotGenerator,
isAsync ? FunctionAsyncKind::AsyncFunction
: FunctionAsyncKind::SyncFunction));
// Push a new ParseContext. It will be used to parse `scope`, the arguments, the function.
@@ -5294,17 +5300,17 @@ BinASTParser<Tok>::parseInterfaceStaticM
{
MOZ_ASSERT(kind == BinKind::StaticMemberAssignmentTarget);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Object, BinField::Property }));
MOZ_TRY_DECL(object, parseExpressionOrSuper());
RootedAtom property((cx_));
- MOZ_TRY(readString(&property));
+ MOZ_TRY_VAR(property, tokenizer_->readAtom());
TRY_DECL(result, factory_.newPropertyAccess(object, property->asPropertyName(), start));return result;
}
/*
interface StaticMemberExpression : Node {
(Expression or Super) object;
@@ -5332,17 +5338,17 @@ BinASTParser<Tok>::parseInterfaceStaticM
{
MOZ_ASSERT(kind == BinKind::StaticMemberExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::Object, BinField::Property }));
MOZ_TRY_DECL(object, parseExpressionOrSuper());
RootedAtom property((cx_));
- MOZ_TRY(readString(&property));
+ MOZ_TRY_VAR(property, tokenizer_->readAtom());
TRY_DECL(result, factory_.newPropertyAccess(object, property->asPropertyName(), start));return result;
}
/*
interface Super : Node {
}
@@ -5869,17 +5875,17 @@ BinASTParser<Tok>::parseUpdateExpression
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseInterfaceUpdateExpression(const size_t start, const BinKind kind, const BinFields& fields)
{
MOZ_ASSERT(kind == BinKind::UpdateExpression);
MOZ_TRY(tokenizer_->checkFields(kind, fields, { BinField::IsPrefix, BinField::Operator, BinField::Operand }));
- MOZ_TRY_DECL(isPrefix, readBool());
+ MOZ_TRY_DECL(isPrefix, tokenizer_->readBool());
MOZ_TRY_DECL(operator_, parseUpdateOperator());
MOZ_TRY_DECL(operand, parseSimpleAssignmentTarget());
ParseNodeKind pnk;
@@ -6239,19 +6245,19 @@ BinASTParser<Tok>::parseBinaryOperator()
case BinVariant::BinaryOperatorInstanceof:
return BinaryOperator::Instanceof;
case BinVariant::BinaryOperatorLsh:
return BinaryOperator::Lsh;
case BinVariant::BinaryOperatorRsh:
return BinaryOperator::Rsh;
case BinVariant::BinaryOperatorUrsh:
return BinaryOperator::Ursh;
- case BinVariant::BinaryOperatorPlus:
+ case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
return BinaryOperator::Plus;
- case BinVariant::BinaryOperatorMinus:
+ case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
return BinaryOperator::Minus;
case BinVariant::BinaryOperatorMul:
return BinaryOperator::Mul;
case BinVariant::BinaryOperatorDiv:
return BinaryOperator::Div;
case BinVariant::BinaryOperatorMod:
return BinaryOperator::Mod;
case BinVariant::BinaryOperatorPow:
@@ -6324,19 +6330,19 @@ enum UnaryOperator {
};
*/
template<typename Tok> JS::Result<typename BinASTParser<Tok>::UnaryOperator>
BinASTParser<Tok>::parseUnaryOperator()
{
MOZ_TRY_DECL(variant, tokenizer_->readVariant());
switch (variant) {
- case BinVariant::UnaryOperatorPlus:
+ case BinVariant::BinaryOperatorOrUnaryOperatorPlus:
return UnaryOperator::Plus;
- case BinVariant::UnaryOperatorMinus:
+ case BinVariant::BinaryOperatorOrUnaryOperatorMinus:
return UnaryOperator::Minus;
case BinVariant::UnaryOperatorNot:
return UnaryOperator::Not;
case BinVariant::UnaryOperatorBitNot:
return UnaryOperator::BitNot;
case BinVariant::UnaryOperatorTypeof:
return UnaryOperator::Typeof;
case BinVariant::UnaryOperatorVoid:
@@ -6800,29 +6806,29 @@ BinASTParser<Tok>::parseOptionalExpressi
return result;
}
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseOptionalIdentifierName()
{
RootedAtom string((cx_));
- MOZ_TRY(readMaybeString(&string));
+ MOZ_TRY_VAR(string, tokenizer_->readMaybeAtom());
return raiseError("FIXME: Not implemented yet (OptionalIdentifierName)");
}
template<typename Tok> JS::Result<ParseNode*>
BinASTParser<Tok>::parseOptionalLabel()
{
RootedAtom string((cx_));
- MOZ_TRY(readMaybeString(&string));
+ MOZ_TRY_VAR(string, tokenizer_->readMaybeAtom());
return raiseError("FIXME: Not implemented yet (OptionalLabel)");
}
template<typename Tok> JS::Result<ParseNode*>
@@ -6882,10 +6888,23 @@ BinASTParser<Tok>::parseOptionalVariable
}
MOZ_TRY(guard.done());
return result;
}
+// Force class instantiation.
+// This ensures that the symbols are built, without having to export all our
+// code (and its baggage of #include and macros) in the header.
+template class BinASTParser<BinTokenReaderMultipart>;
+template class BinASTParser<BinTokenReaderTester>;
+
} // namespace frontend
} // namespace js
+
+#undef TRY
+#undef TRY_VAR
+#undef TRY_DECL
+#undef TRY_EMPL
+#undef MOZ_TRY_EMPLACE
+#undef MOZ_TRY_DECL
--- a/js/src/frontend/BinSource-macros.h
+++ b/js/src/frontend/BinSource-macros.h
@@ -59,14 +59,19 @@
//
// In case of error, propagate the error.
#define MOZ_TRY_DECL(VAR, EXPR) \
auto _##VAR = EXPR; \
if (_##VAR.isErr()) \
return ::mozilla::Err(_##VAR.unwrapErr()); \
auto VAR = _##VAR.unwrap();
-#define UNDEFINE_BINSOURCE_MACROS \
-#undef TRY \
-#undef TRY_VAR \
+/*
+Don't forget to add this at the end of your code:
+#undef TRY
+#undef TRY_VAR
+#undef TRY_DECL
#undef TRY_EMPL
+#undef MOZ_TRY_EMPLACE
+#undef MOZ_TRY_DECL
+*/
#endif // frontend_BinSourceMacros_h
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -208,34 +208,34 @@ BinASTParser<Tok>::parseAndUpdateCapture
AutoList guard(*tokenizer_);
uint32_t length = 0;
MOZ_TRY(tokenizer_->enterList(length, guard));
RootedAtom name(cx_);
for (uint32_t i = 0; i < length; ++i) {
name = nullptr;
- MOZ_TRY(readString(&name));
+ MOZ_TRY_VAR(name, tokenizer_->readAtom());
}
MOZ_TRY(guard.done());
return Ok();
}
template<typename Tok> JS::Result<Ok>
BinASTParser<Tok>::parseAndUpdateScopeNames(ParseContext::Scope& scope, DeclarationKind kind)
{
AutoList guard(*tokenizer_);
uint32_t length = 0;
MOZ_TRY(tokenizer_->enterList(length, guard));
RootedAtom name(cx_);
for (uint32_t i = 0; i < length; ++i) {
name = nullptr;
- MOZ_TRY(readString(&name));
+ MOZ_TRY_VAR(name, tokenizer_->readAtom());
auto ptr = scope.lookupDeclaredNameForAdd(name);
if (ptr)
return raiseError("Variable redeclaration");
TRY(scope.addDeclaredName(parseContext_, ptr, name.get(), kind, tokenizer_->offset()));
}
MOZ_TRY(guard.done());
return Ok();
@@ -340,18 +340,17 @@ BinASTParser<Tok>::raiseEmpty(const char
TRY(out.printf("Empty %s", description));
return raiseError(out.string());
}
template<typename Tok> mozilla::GenericErrorResult<JS::Error&>
BinASTParser<Tok>::raiseOOM()
{
- ReportOutOfMemory(cx_);
- return cx_->alreadyReportedError();
+ return tokenizer_->raiseOOM();
}
template<typename Tok> mozilla::GenericErrorResult<JS::Error&>
BinASTParser<Tok>::raiseError(BinKind kind, const char* description)
{
Sprinter out(cx_);
TRY(out.init());
TRY(out.printf("In %s, ", description));
@@ -390,19 +389,27 @@ BinASTParserBase::hasUsedName(HandleProp
}
void
TraceBinParser(JSTracer* trc, AutoGCRooter* parser)
{
static_cast<BinASTParserBase*>(parser)->trace(trc);
}
+
+// Force class instantiation.
+// This ensures that the symbols are built, without having to export all our
+// code (and its baggage of #include and macros) in the header.
+template class BinASTParser<BinTokenReaderMultipart>;
+template class BinASTParser<BinTokenReaderTester>;
+
} // namespace frontend
} // namespace js
-
// #undef everything, to avoid collisions with unified builds.
#undef TRY
#undef TRY_VAR
#undef TRY_DECL
#undef TRY_EMPL
#undef MOZ_TRY_EMPLACE
+#undef MOZ_TRY_DECL
+
--- a/js/src/frontend/BinSource.h
+++ b/js/src/frontend/BinSource.h
@@ -34,18 +34,18 @@ namespace frontend {
class BinASTParserBase: private JS::AutoGCRooter
{
public:
BinASTParserBase(JSContext* cx, LifoAlloc& alloc, UsedNameTracker& usedNames)
: AutoGCRooter(cx, BINPARSER)
, cx_(cx)
, alloc_(alloc)
, traceListHead_(nullptr)
+ , usedNames_(usedNames)
, nodeAlloc_(cx, alloc)
- , usedNames_(usedNames)
, keepAtoms_(cx)
, parseContext_(nullptr)
, factory_(cx, alloc, nullptr, SourceKind::Binary)
{
cx->frontendCollectionPool().addActiveCompilation();
tempPoolMark_ = alloc.mark();
}
~BinASTParserBase()
@@ -215,24 +215,16 @@ class BinASTParser : public BinASTParser
MOZ_MUST_USE JS::Result<Ok> parseAndUpdateCapturedNames();
MOZ_MUST_USE JS::Result<Ok> checkBinding(JSAtom* name);
// --- Utilities.
MOZ_MUST_USE JS::Result<ParseNode*> appendDirectivesToBody(ParseNode* body,
ParseNode* directives);
- // Read a string
- MOZ_MUST_USE JS::Result<Ok> readString(Chars& out);
- MOZ_MUST_USE JS::Result<Ok> readMaybeString(Maybe<Chars>& out);
- MOZ_MUST_USE JS::Result<Ok> readString(MutableHandleAtom out);
- MOZ_MUST_USE JS::Result<Ok> readMaybeString(MutableHandleAtom out);
- MOZ_MUST_USE JS::Result<bool> readBool();
- MOZ_MUST_USE JS::Result<double> readNumber();
-
private: // Implement ErrorReporter
const ReadOnlyCompileOptions& options_;
const ReadOnlyCompileOptions& options() const override {
return this->options_;
}
virtual void lineAndColumnAt(size_t offset, uint32_t* line, uint32_t* column) const override {
@@ -288,12 +280,15 @@ class BinParseContext : public ParseCont
BinParseContext(JSContext* cx, BinASTParser<Tok>* parser, SharedContext* sc,
Directives* newDirectives)
: ParseContext(cx, parser->parseContext_, sc, *parser,
parser->usedNames_, newDirectives, /* isFull = */ true)
{ }
};
+extern template class BinASTParser<BinTokenReaderMultipart>;
+extern template class BinASTParser<BinTokenReaderTester>;
+
} // namespace frontend
} // namespace js
#endif // frontend_BinSource_h
\ No newline at end of file
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinSource.yaml
@@ -45,19 +45,33 @@ cpp:
// a string literal (and ONLY a string literal).
template<typename Tok, size_t N>
bool operator==(const typename Tok::Chars& left, const char (&right)[N]) {
return Tok::equals(left, right);
}
footer: |
+ // Force class instantiation.
+ // This ensures that the symbols are built, without having to export all our
+ // code (and its baggage of #include and macros) in the header.
+ template class BinASTParser<BinTokenReaderMultipart>;
+ template class BinASTParser<BinTokenReaderTester>;
+
} // namespace frontend
} // namespace js
+ #undef TRY
+ #undef TRY_VAR
+ #undef TRY_DECL
+ #undef TRY_EMPL
+ #undef MOZ_TRY_EMPLACE
+ #undef MOZ_TRY_DECL
+
+
hpp:
# Rules for generating BinSource-class.h
class:
header: |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -375,22 +389,23 @@ Block:
fprintf(stderr, "Block: POP parse context\n");
BreakStatement:
fields:
label:
block:
replace: |
RootedAtom label(cx_);
- MOZ_TRY(readMaybeString(&label));
+ MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
- if (label && !IsIdentifier(label))
- return raiseError("Invalid identifier");
build: |
if (label) {
+ if (!IsIdentifier(label))
+ return raiseError("Invalid identifier");
+
auto validity = parseContext_->checkBreakStatement(label->asPropertyName());
if (validity.isErr()) {
switch (validity.unwrapErr()) {
case ParseContext::BreakStatementError::ToughBreak:
return raiseError(kind, "Not in a loop");
case ParseContext::BreakStatementError::LabelNotFound:
return raiseError(kind, "Label not found");
@@ -491,22 +506,23 @@ ConditionalExpression:
TRY_DECL(result, factory_.newConditional(test, consequent, alternate));
ContinueStatement:
fields:
label:
block:
replace: |
RootedAtom label(cx_);
- MOZ_TRY(readMaybeString(&label));
+ MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
- if (label && !IsIdentifier(label))
- return raiseError("ContinueStatement - Label MUST be an identifier");
build: |
if (label) {
+ if (!IsIdentifier(label))
+ return raiseError("ContinueStatement - Label MUST be an identifier");
+
auto validity = parseContext_->checkContinueStatement(label ? label->asPropertyName() : nullptr);
if (validity.isErr()) {
switch (validity.unwrapErr()) {
case ParseContext::ContinueStatementError::NotInALoop:
return raiseError(kind, "Not in a loop");
case ParseContext::ContinueStatementError::LabelNotFound:
return raiseError(kind, "Label not found");
}
@@ -721,33 +737,39 @@ LiteralPropertyName:
else
TRY_VAR(result, factory_.newObjectLiteralPropertyName(value, tokenizer_->pos(start)));
LiteralRegExpExpression:
fields:
flags:
block:
replace: |
- Chars flags(cx_);
- MOZ_TRY(readString(flags));
+ RootedAtom flags(cx_);
+ MOZ_TRY_VAR(flags, tokenizer_->readAtom());
build: |
RegExpFlag reflags = NoFlags;
- for (auto c : flags) {
- if (c == 'g' && !(reflags & GlobalFlag))
- reflags = RegExpFlag(reflags | GlobalFlag);
- else if (c == 'i' && !(reflags & IgnoreCaseFlag))
- reflags = RegExpFlag(reflags | IgnoreCaseFlag);
- else if (c == 'm' && !(reflags & MultilineFlag))
- reflags = RegExpFlag(reflags | MultilineFlag);
- else if (c == 'y' && !(reflags & StickyFlag))
- reflags = RegExpFlag(reflags | StickyFlag);
- else if (c == 'u' && !(reflags & UnicodeFlag))
- reflags = RegExpFlag(reflags | UnicodeFlag);
- else
- return raiseError("Invalid flags");
+ JSAutoByteString autoBytes;
+ const char* bytes = AtomToPrintableString(cx_, flags.get(), &autoBytes);
+
+ if (bytes) {
+ for (; *bytes != 0; ++bytes) {
+ const char c = *bytes;
+ if (c == 'g' && !(reflags & GlobalFlag))
+ reflags = RegExpFlag(reflags | GlobalFlag);
+ else if (c == 'i' && !(reflags & IgnoreCaseFlag))
+ reflags = RegExpFlag(reflags | IgnoreCaseFlag);
+ else if (c == 'm' && !(reflags & MultilineFlag))
+ reflags = RegExpFlag(reflags | MultilineFlag);
+ else if (c == 'y' && !(reflags & StickyFlag))
+ reflags = RegExpFlag(reflags | StickyFlag);
+ else if (c == 'u' && !(reflags & UnicodeFlag))
+ reflags = RegExpFlag(reflags | UnicodeFlag);
+ else
+ return raiseError("Invalid flags");
+ }
}
Rooted<RegExpObject*> reobj(cx_);
TRY_VAR(reobj, RegExpObject::create(cx_,
pattern,
reflags,
alloc_,
--- a/js/src/frontend/BinSourceRuntimeSupport.h
+++ b/js/src/frontend/BinSourceRuntimeSupport.h
@@ -39,23 +39,35 @@ struct BinaryASTSupport {
byteLen_(byteLen)
{ }
const char* begin() const {
return start_;
}
const char* end() const {
return start_ + byteLen_;
}
-
+#ifdef DEBUG
+ void dump() const {
+ for (auto c: *this) {
+ fprintf(stderr, "%c", c);
+ }
+ fprintf(stderr, " (%d)", byteLen_);
+ }
+#endif // DEBUG
typedef const CharSlice Lookup;
static js::HashNumber hash(Lookup l) {
return mozilla::HashString(l.start_, l.byteLen_);
}
static bool match(const Lookup key, Lookup lookup) {
+ fprintf(stderr, "CharSlice::match: ");
+ key.dump();
+ fprintf(stderr, " vs ");
+ key.dump();
+ fprintf(stderr, "\n");
if (key.byteLen_ != lookup.byteLen_)
return false;
return strncmp(key.start_, lookup.start_, key.byteLen_) == 0;
}
};
JS::Result<mozilla::Maybe<BinVariant>> binVariant(JSContext*, const CharSlice);
JS::Result<mozilla::Maybe<BinField>> binField(JSContext*, const CharSlice);
--- a/js/src/frontend/BinToken.cpp
+++ b/js/src/frontend/BinToken.cpp
@@ -38,17 +38,17 @@ const char* BINVARIANT_DESCRIPTIONS[] =
const char* describeBinKind(const BinKind& kind) {
return BINKIND_DESCRIPTIONS[static_cast<size_t>(kind)];
}
const char* describeBinField(const BinField& field) {
return BINFIELD_DESCRIPTIONS[static_cast<size_t>(field)];
}
-const char* describeBinVariant(const BinVariant field) {
+const char* describeBinVariant(const BinVariant& field) {
return BINVARIANT_DESCRIPTIONS[static_cast<size_t>(field)];
}
} // namespace frontend
JS::Result<mozilla::Maybe<js::frontend::BinKind>>
BinaryASTSupport::binKind(JSContext* cx, const CharSlice key) {
@@ -56,16 +56,20 @@ BinaryASTSupport::binKind(JSContext* cx,
// Initialize lazily.
if (!binKindMap_.init(frontend::BINKIND_LIMIT))
return cx->alreadyReportedError();
#define WITH_BIN_KIND(CPP_NAME, SPEC_NAME) \
{ \
/* Prepare the value. It will back the CharSlice. */ \
JS::UniqueChars name(static_cast<char*>(js_malloc(sizeof(#SPEC_NAME)))); \
+ if (!name) { \
+ ReportOutOfMemory(cx); \
+ return cx->alreadyReportedError(); \
+ } \
memcpy(name.get(), #SPEC_NAME, sizeof(#SPEC_NAME)); \
NamedValue<BinKind> value(Move(name), BinKind::CPP_NAME); \
\
CharSlice key(value.name(), sizeof(#SPEC_NAME) - 1); \
auto ptr = binKindMap_.lookupForAdd(key); \
MOZ_ASSERT(!ptr); \
if (!binKindMap_.add(ptr, Move(key), Move(value))) \
return cx->alreadyReportedError(); \
@@ -76,36 +80,47 @@ BinaryASTSupport::binKind(JSContext* cx,
auto ptr = binKindMap_.lookup(key);
if (!ptr)
return Result<Maybe<BinKind>>(mozilla::Nothing());
return mozilla::Some(ptr->value().value());
}
-
JS::Result<mozilla::Maybe<js::frontend::BinVariant>>
BinaryASTSupport::binVariant(JSContext* cx, const CharSlice key) {
+#if 1
+ fprintf(stderr, "BinaryASTSupport::binVariant(");
+ key.dump();
+ fprintf(stderr, ")\n");
+#endif
if (!binVariantMap_.initialized()) {
// Initialize lazily.
if (!binVariantMap_.init(frontend::BINVARIANT_LIMIT))
return cx->alreadyReportedError();
-#define WITH_BIN_VARIANT(CPP_NAME, SPEC_NAME) \
- { \
- /* Prepare the value. It will back the CharSlice. */ \
- JS::UniqueChars name(static_cast<char*>(js_malloc(sizeof(#SPEC_NAME)))); \
- memcpy(name.get(), #SPEC_NAME, sizeof(#SPEC_NAME)); \
- NamedValue<BinVariant> value(Move(name), BinVariant::CPP_NAME); \
- \
- CharSlice key(value.name(), sizeof(#SPEC_NAME) - 1); \
- auto ptr = binVariantMap_.lookupForAdd(key); \
- MOZ_ASSERT(!ptr); \
- if (!binVariantMap_.add(ptr, Move(key), Move(value))) \
- return cx->alreadyReportedError(); \
+#define WITH_BIN_VARIANT(CPP_NAME, SPEC_NAME) \
+ { \
+ /* Prepare the value. It will back the CharSlice. */ \
+ JS::UniqueChars name(static_cast<char*>(js_malloc(sizeof(SPEC_NAME)))); \
+ if (!name) { \
+ ReportOutOfMemory(cx); \
+ return cx->alreadyReportedError(); \
+ } \
+ memcpy(name.get(), SPEC_NAME, sizeof(SPEC_NAME)); \
+ NamedValue<BinVariant> value(Move(name), BinVariant::CPP_NAME); \
+ \
+ CharSlice key(value.name(), sizeof(SPEC_NAME) - 1); \
+ fprintf(stderr, "BinaryASTSupport::binVariant.init("); \
+ key.dump(); \
+ fprintf(stderr, ") => BinVariant::%s\n", #CPP_NAME); \
+ auto ptr = binVariantMap_.lookupForAdd(key); \
+ MOZ_ASSERT(!ptr); \
+ if (!binVariantMap_.add(ptr, Move(key), Move(value))) \
+ return cx->alreadyReportedError(); \
}
FOR_EACH_BIN_VARIANT(WITH_BIN_VARIANT)
#undef WITH_BIN_VARIANT
}
auto ptr = binVariantMap_.lookup(key);
if (!ptr)
return Result<Maybe<BinVariant>>(mozilla::Nothing());
--- a/js/src/frontend/BinToken.h
+++ b/js/src/frontend/BinToken.h
@@ -334,75 +334,73 @@ enum class BinField {
FOR_EACH_BIN_FIELD(EMIT_ENUM)
#undef EMIT_ENUM
};
// The number of distinct values of BinField.
const size_t BINFIELD_LIMIT = 61;
#define FOR_EACH_BIN_VARIANT(F) \
- F(BinaryOperatorNeq, "!=") \
- F(BinaryOperatorStrictNeq, "!==") \
- F(BinaryOperatorMod, "%") \
F(BinaryOperatorBitAnd, "&") \
- F(BinaryOperatorLogicalAnd, "&&") \
- F(BinaryOperatorMul, "*") \
- F(BinaryOperatorPow, "**") \
- F(BinaryOperatorPlus, "+") \
+ F(BinaryOperatorBitOr, "|") \
+ F(BinaryOperatorBitXor, "^") \
F(BinaryOperatorComma, ",") \
- F(BinaryOperatorMinus, "-") \
F(BinaryOperatorDiv, "/") \
- F(BinaryOperatorLessThan, "<") \
- F(BinaryOperatorLsh, "<<") \
- F(BinaryOperatorLeqThan, "<=") \
F(BinaryOperatorEq, "==") \
- F(BinaryOperatorStrictEq, "===") \
+ F(BinaryOperatorGeqThan, ">=") \
F(BinaryOperatorGreaterThan, ">") \
- F(BinaryOperatorGeqThan, ">=") \
- F(BinaryOperatorRsh, ">>") \
- F(BinaryOperatorUrsh, ">>>") \
- F(BinaryOperatorBitXor, "^") \
F(BinaryOperatorIn, "in") \
F(BinaryOperatorInstanceof, "instanceof") \
- F(BinaryOperatorBitOr, "|") \
+ F(BinaryOperatorLeqThan, "<=") \
+ F(BinaryOperatorLessThan, "<") \
+ F(BinaryOperatorLogicalAnd, "&&") \
F(BinaryOperatorLogicalOr, "||") \
+ F(BinaryOperatorLsh, "<<") \
+ F(BinaryOperatorMod, "%") \
+ F(BinaryOperatorMul, "*") \
+ F(BinaryOperatorNeq, "!=") \
+ F(BinaryOperatorOrUnaryOperatorMinus, "-") \
+ F(BinaryOperatorOrUnaryOperatorPlus, "+") \
+ F(BinaryOperatorPow, "**") \
+ F(BinaryOperatorRsh, ">>") \
+ F(BinaryOperatorStrictEq, "===") \
+ F(BinaryOperatorStrictNeq, "!==") \
+ F(BinaryOperatorUrsh, ">>>") \
+ F(CompoundAssignmentOperatorBitAndAssign, "&=") \
+ F(CompoundAssignmentOperatorBitOrAssign, "|=") \
+ F(CompoundAssignmentOperatorBitXorAssign, "^=") \
+ F(CompoundAssignmentOperatorDivAssign, "/=") \
+ F(CompoundAssignmentOperatorLshAssign, "<<=") \
+ F(CompoundAssignmentOperatorMinusAssign, "-=") \
F(CompoundAssignmentOperatorModAssign, "%=") \
- F(CompoundAssignmentOperatorBitAndAssign, "&=") \
- F(CompoundAssignmentOperatorPowAssign, "**=") \
F(CompoundAssignmentOperatorMulAssign, "*=") \
F(CompoundAssignmentOperatorPlusAssign, "+=") \
- F(CompoundAssignmentOperatorMinusAssign, "-=") \
- F(CompoundAssignmentOperatorDivAssign, "/=") \
- F(CompoundAssignmentOperatorLshAssign, "<<=") \
+ F(CompoundAssignmentOperatorPowAssign, "**=") \
F(CompoundAssignmentOperatorRshAssign, ">>=") \
F(CompoundAssignmentOperatorUrshAssign, ">>>=") \
- F(CompoundAssignmentOperatorBitXorAssign, "^=") \
- F(CompoundAssignmentOperatorBitOrAssign, "|=") \
+ F(UnaryOperatorBitNot, "~") \
+ F(UnaryOperatorDelete, "delete") \
F(UnaryOperatorNot, "!") \
- F(UnaryOperatorPlus, "+") \
- F(UnaryOperatorMinus, "-") \
- F(UnaryOperatorDelete, "delete") \
F(UnaryOperatorTypeof, "typeof") \
F(UnaryOperatorVoid, "void") \
- F(UnaryOperatorBitNot, "~") \
+ F(UpdateOperatorDecr, "--") \
F(UpdateOperatorIncr, "++") \
- F(UpdateOperatorDecr, "--") \
F(VariableDeclarationKindConst, "const") \
F(VariableDeclarationKindLet, "let") \
F(VariableDeclarationKindVar, "var")
enum class BinVariant {
#define EMIT_ENUM(name, _) name,
FOR_EACH_BIN_VARIANT(EMIT_ENUM)
#undef EMIT_ENUM
};
// The number of distinct values of BinVariant.
-const size_t BINVARIANT_LIMIT = 49;
+const size_t BINVARIANT_LIMIT = 0;
/**
* Return a string describing a `BinKind`.
*/
const char* describeBinKind(const BinKind& kind);
/**
* Return a string describing a `BinField`.
--- a/js/src/frontend/BinTokenReaderBase.cpp
+++ b/js/src/frontend/BinTokenReaderBase.cpp
@@ -21,16 +21,23 @@ BinTokenReaderBase::raiseError(const cha
MOZ_ASSERT(!cx_->isExceptionPending());
TokenPos pos = this->pos();
JS_ReportErrorASCII(cx_, "BinAST parsing error: %s at offsets %u => %u",
description, pos.begin, pos.end);
return cx_->alreadyReportedError();
}
ErrorResult<JS::Error&>
+BinTokenReaderBase::raiseOOM()
+{
+ ReportOutOfMemory(cx_);
+ return cx_->alreadyReportedError();
+}
+
+ErrorResult<JS::Error&>
BinTokenReaderBase::raiseInvalidNumberOfFields(const BinKind kind, const uint32_t expected, const uint32_t got)
{
Sprinter out(cx_);
TRY(out.init());
TRY(out.printf("In %s, invalid number of fields: expected %u, got %u",
describeBinKind(kind), expected, got));
return raiseError(out.string());
}
@@ -43,23 +50,23 @@ BinTokenReaderBase::raiseInvalidField(co
TRY(out.printf("In %s, invalid field '%s'", kind, describeBinField(field)));
return raiseError(out.string());
}
size_t
BinTokenReaderBase::offset() const
{
- return latestKnownGoodPos_;
+ return current_ - start_;
}
TokenPos
BinTokenReaderBase::pos()
{
- return pos(latestKnownGoodPos_);
+ return pos(offset());
}
TokenPos
BinTokenReaderBase::pos(size_t start)
{
TokenPos pos;
pos.begin = start;
pos.end = current_ - start_;
--- a/js/src/frontend/BinTokenReaderBase.h
+++ b/js/src/frontend/BinTokenReaderBase.h
@@ -49,16 +49,17 @@ class MOZ_STACK_CLASS BinTokenReaderBase
const BinKind kind, const uint32_t expected, const uint32_t got);
MOZ_MUST_USE ErrorResult<JS::Error&> raiseInvalidField(const char* kind,
const BinField field);
protected:
BinTokenReaderBase(JSContext* cx, const uint8_t* start, const size_t length)
: cx_(cx)
, start_(start)
+ , current_(start)
, stop_(start + length)
, latestKnownGoodPos_(0)
{ }
/**
* Read a single byte.
*/
MOZ_MUST_USE JS::Result<uint8_t> readByte();
--- a/js/src/frontend/BinTokenReaderMultipart.cpp
+++ b/js/src/frontend/BinTokenReaderMultipart.cpp
@@ -51,18 +51,18 @@ BinTokenReaderMultipart::readHeader()
MOZ_TRY(readConst(MAGIC_HEADER));
MOZ_TRY_DECL(version, readInternalUint32());
if (version != MAGIC_FORMAT_VERSION)
return raiseError("Format version not implemented");
// Start reading grammar.
MOZ_TRY(readConst(SECTION_HEADER_GRAMMAR));
MOZ_TRY(readConst(COMPRESSION_IDENTITY)); // For the moment, we only support identity compression.
+ MOZ_TRY_DECL(grammarByteLen, readInternalUint32());
const auto posBeforeGrammar = current_;
- MOZ_TRY_DECL(grammarByteLen, readInternalUint32());
if (grammarByteLen > stop_ - posBeforeGrammar) // Sanity check.
return raiseError("Invalid byte length in grammar table");
MOZ_TRY_DECL(grammarNumberOfEntries, readInternalUint32());
if (grammarNumberOfEntries > BINKIND_LIMIT) // Sanity check.
return raiseError("Invalid number of entries in grammar table");
@@ -73,78 +73,79 @@ BinTokenReaderMultipart::readHeader()
for (uint32_t i = 0; i < grammarNumberOfEntries; ++i) {
MOZ_TRY_DECL(byteLen, readInternalUint32());
if (current_ + byteLen > stop_)
return raiseError("Invalid byte length in grammar table");
if (current_ + byteLen < current_) // Overflow.
return raiseError("Invalid byte length in grammar table");
CharSlice name((const char*)current_, byteLen);
+ current_ += byteLen;
MOZ_TRY_DECL(kind, cx_->runtime()->binast().binKind(cx_, name));
if (!kind)
return raiseError("Invalid entry in grammar table");
- if (grammarTable.append(*kind)) // We called `reserve` before the loop.
+ if (!grammarTable.append(*kind)) // We called `reserve` before the loop.
MOZ_CRASH();
}
- if (current_ - posBeforeGrammar)
+ if (current_ - posBeforeGrammar != grammarByteLen)
return raiseError("The length of the grammar table didn't match its contents.");
// Start reading strings
MOZ_TRY(readConst(SECTION_HEADER_STRINGS));
MOZ_TRY(readConst(COMPRESSION_IDENTITY)); // For the moment, we only support identity compression.
+ MOZ_TRY_DECL(stringsByteLen, readInternalUint32());
const auto posBeforeStrings = current_;
- MOZ_TRY_DECL(stringsByteLen, readInternalUint32());
if (stringsByteLen > stop_ - posBeforeStrings) // Sanity check.
return raiseError("Invalid byte length in strings table");
MOZ_TRY_DECL(stringsNumberOfEntries, readInternalUint32());
if (stringsNumberOfEntries > MAX_NUMBER_OF_STRINGS) // Sanity check.
return raiseError("Too many entries in strings table");
// This table maps String index -> String.
// Initialize and populate.
if (!atomsTable.reserve(stringsNumberOfEntries))
return raiseOOM();
+ if (!variantsTable.init())
+ return cx_->alreadyReportedError();
RootedAtom atom(cx_);
for (uint32_t i = 0; i < stringsNumberOfEntries; ++i) {
- MOZ_TRY_DECL(byteLength, readInternalUint32());
- if (byteLength > stop_ - current_)
+ MOZ_TRY_DECL(byteLen, readInternalUint32());
+ if (byteLen > stop_ - current_)
return raiseError("Invalid byte length in individual string");
// Check null string.
- if (byteLength == 2 && *current_ == 255 && *(current_ + 1) == 0) {
+ if (byteLen == 2 && *current_ == 255 && *(current_ + 1) == 0) {
atom = nullptr;
} else {
- TRY_VAR(atom, Atomize(cx_, (const char*)current_, byteLength));
+ TRY_VAR(atom, Atomize(cx_, (const char*)current_, byteLen));
}
// Populate `atomsTable`: i => atom.
if (!atomsTable.append(atom))
MOZ_CRASH(); // We have reserved before entering the loop above.
// Populate `variantsTable`: i => variant, if this atom maps to a variant.
if (atom) {
- CharSlice slice((const char*)current_, byteLength);
+ CharSlice slice((const char*)current_, byteLen);
MOZ_TRY_DECL(variant, cx_->runtime()->binast().binVariant(cx_, slice));
if (variant) {
auto ptr = variantsTable.lookupForAdd(i);
MOZ_ASSERT(!ptr);
if (!variantsTable.add(ptr, i, *variant))
return raiseOOM();
}
}
- current_ += byteLength;
-
-
+ current_ += byteLen;
}
if (current_ - posBeforeStrings != stringsByteLen)
return raiseError("The length of the strings table didn't match its contents.");
// Start reading AST.
MOZ_TRY(readConst(SECTION_HEADER_TREE));
MOZ_TRY(readConst(COMPRESSION_IDENTITY)); // For the moment, we only support identity compression.
@@ -238,16 +239,27 @@ BinTokenReaderMultipart::readMaybeAtom()
if (index >= atomsTable.length())
return raiseError("Invalid index to strings table");
RootedAtom atom(cx_);
atom = atomsTable[index];
return atom.get();
}
+JS::Result<JSAtom*>
+BinTokenReaderMultipart::readAtom()
+{
+ MOZ_TRY_DECL(maybe, readMaybeAtom());
+
+ if (!maybe)
+ return raiseError("Empty string");
+
+ return maybe;
+}
+
JS::Result<BinVariant>
BinTokenReaderMultipart::readVariant()
{
updateLatestKnownGood();
MOZ_TRY_DECL(index, readInternalUint32());
if (index >= atomsTable.length())
return raiseError("Invalid index to strings table for string enum");
--- a/js/src/frontend/BinTokenReaderMultipart.h
+++ b/js/src/frontend/BinTokenReaderMultipart.h
@@ -85,16 +85,17 @@ class MOZ_STACK_CLASS BinTokenReaderMult
MOZ_MUST_USE JS::Result<double> readDouble();
/**
* Read a single `string | null` value.
*
* Fails if that string is not valid UTF-8.
*/
MOZ_MUST_USE JS::Result<JSAtom*> readMaybeAtom();
+ MOZ_MUST_USE JS::Result<JSAtom*> readAtom();
/**
* Read a single `BinVariant | null` value.
*/
MOZ_MUST_USE JS::Result<Maybe<BinVariant>> readMaybeVariant();
MOZ_MUST_USE JS::Result<BinVariant> readVariant();
// --- Composite values.
--- a/js/src/frontend/BinTokenReaderTester.cpp
+++ b/js/src/frontend/BinTokenReaderTester.cpp
@@ -20,16 +20,21 @@ using BinFields = BinTokenReaderTester::
using AutoList = BinTokenReaderTester::AutoList;
using AutoTaggedTuple = BinTokenReaderTester::AutoTaggedTuple;
using AutoTuple = BinTokenReaderTester::AutoTuple;
BinTokenReaderTester::BinTokenReaderTester(JSContext* cx, const uint8_t* start, const size_t length)
: BinTokenReaderBase(cx, start, length)
{ }
+JS::Result<Ok>
+BinTokenReaderTester::readHeader()
+{
+ return Ok();
+}
// Nullable booleans:
//
// 0 => false
// 1 => true
// 2 => null
JS::Result<Maybe<bool>>
BinTokenReaderTester::readMaybeBool()
@@ -159,16 +164,44 @@ BinTokenReaderTester::readAtom()
RootedAtom atom(cx_);
MOZ_TRY_VAR(atom, readMaybeAtom());
if (!atom)
return raiseError("Empty string");
return atom.get();
}
+JS::Result<BinVariant>
+BinTokenReaderTester::readVariant()
+{
+ RootedAtom atom(cx_);
+ MOZ_TRY_DECL(byteLen, readInternalUint32());
+
+ // 2. Reject if we can't read
+ if (current_ + byteLen < current_) // Check for overflows
+ return raiseError("Arithmetics overflow: string is too long");
+
+ if (current_ + byteLen > stop_)
+ return raiseError("Not enough bytes to read chars");
+
+ if (byteLen == 2 && *current_ == 255 && *(current_ + 1) == 0) {
+ // 3. Special case: null string.
+ return raiseError("Empty variant");
+ }
+
+ BinaryASTSupport::CharSlice slice((const char*)current_, byteLen);
+ current_ += byteLen;
+
+ MOZ_TRY_DECL(variant, cx_->runtime()->binast().binVariant(cx_, slice));
+ if (!variant)
+ return raiseError("Not a variant");
+
+ return *variant;
+}
+
// Untagged tuple:
// - "<tuple>";
// - contents (specified by the higher-level grammar);
// - "</tuple>"
JS::Result<Ok>
BinTokenReaderTester::enterUntaggedTuple(AutoTuple& guard)
{
MOZ_TRY(readConst("<tuple>"));
new file mode 100644
index 0000000000000000000000000000000000000000..12dfd448dd3890f919aed7491d2778392814bbce
GIT binary patch
literal 893
zc${@n|7+Sn6h9szgb+dq5{gK<iHPkwX-64lgMm8NS!_B?D2y`XjBhsGH5V@DtUvBA
z*}uBeI8zEE@b10Od!NtylKv>XipbsNq<4MYn|x2_n5k5)Km0M;ozXV<k)j+v<r0e`
z6<K$jDwK>zN~YPO!khgxn`@-vw5w#Kn8HV$Xx%cIvKhxum~bYU60-dg()Cn}F}bb;
z8Ux086`pJa)8rZ-XU}Kr^z^gHHjOIK?sJj+Jg-tQlM7VUob?b_&&sFalJkq_4PH`%
z0aMBSfU{+R%~-Ct;eJIYN@SWVs#z!%&h>gxB67To;>jqyjH(k)jrZm+CgHUk4F~b)
zCiIjj&+6k-g8AkWjvi~t6%=+nipN7gzL}OffbLhOTg+d%x5G)K*-pu|ucEW*xuvjB
zUaZZ46?oAXf+NeixfDvMb&lPCtvW|;N8L+YQ8=P2sekSlWOJ0U7>h+a6m&ld)n#Ip
z<>fgvmHuCqDnS|D`C|5fiK6bV-1*E>j&q=mSqZ#3Jw59_6#ibO9tx%DyL!J+OsdT)
zckyI6tnT+4nk^unYq(xu*$xl_<QoJwalkSRcw0IF)Jw+&YP#eCh_>wj9Q_dkPKjHl
zE$Ebv4PBemwBvamIXO3Jt^U!pNuUwufE<_r?@Yfz9Fusa>**KBq2br+EyMH!8*18G
e8uvAB9+1Ohix|$f8yrKESkQtRvGoiMAb$Y}MF}nd
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/boolean-001.js
@@ -0,0 +1,47 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: boolean-001.js
+ Description: Corresponds to ecma/Boolean/15.6.4.2-4-n.js
+
+ The toString function is not generic; it generates
+ a runtime error if its this value is not a Boolean
+ object. Therefore it cannot be transferred to other
+ kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: june 27, 1997
+*/
+var SECTION = "boolean-001.js";
+var VERSION = "JS1_4";
+var TITLE = "Boolean.prototype.toString()";
+startTest();
+writeHeaderToLog( SECTION +" "+ TITLE );
+
+var exception = "No exception thrown";
+var result = "Failed";
+
+var TO_STRING = Boolean.prototype.toString;
+
+try {
+ var s = new String("Not a Boolean");
+ s.toString = TO_STRING;
+ s.toString();
+} catch ( e ) {
+ result = "Passed!";
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "Assigning Boolean.prototype.toString to a String object "+
+ "(threw " +exception +")",
+ "Passed!",
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..2f7b5f0f70eeec4685727d8d273bda72ccae8c52
GIT binary patch
literal 907
zc${@o@k`r46h0mygb+dqB}gf9E2UKDN+%-XhR}A=RcahfCJY&JO`kO`=E~)2E&FMI
z$^O+{o6?9d0(b9y_ult?_j0{Ka2b-@i&6LLsyq6bOfZv)Tz>kiHCuyqa-X2^UuFXH
zJmFb;m`D^X4W&r3X^A(>FqBN<lWMK^l5C=?N}lEo6A2rq_yyyX2_{u}<1NMoRgFw6
zOUhcGrD>TStR#~73ZKTWy|ub(n`SHN5<Duwh>0o6(oHqMMOkRx1@kmDdnu29QPqS(
z;zW51V?IMGj72h&C$ELy64xWK>@yiZYzN@2(|*e4Io^iRXb@b4<%oZ4XZkY}@ZM4m
z=Bb3-#g`aotD)GT-;V~@f&I+VIbPqJ(I6W7&P{jt-M_m&w{QGWsEz^cZ%kR8ysHLW
zQbv26r^vF}xY$2*I*0AY+-}JSfeUJ#vn0g{>}`lT=f|6d_Dpce<#LAYjbdvrD=w&h
zApLI@m0YP7kAd>>BgT@t+bTDgOvngxNf$!Bo3F?wC?Y=OQ$s4W8F0G2GF2Y=BC`rI
zNAe;7YF>sP?~d$^2WLgsXKJ9)$oI=>{(;>Z5XUxc$2Bw^2m$f~JcC$Z>Lyf+z=e|{
zu%V&ZWFLrH4?M8cM@%>-c5!S#rwBCIHAqDTj^mKimQ}CroaqMf6ry|NPzTu2TuO9{
w)HT~tJCKH6sqQp1&8=wQsnt+;<wz-c<nz8kOlz$MO{ftAD0oCu9@;?u0SYz^Z2$lO
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/boolean-002.js
@@ -0,0 +1,51 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: boolean-001.js
+ Description: Corresponds to ecma/Boolean/15.6.4.3-4-n.js
+
+ 15.6.4.3 Boolean.prototype.valueOf()
+ Returns this boolean value.
+
+ The valueOf function is not generic; it generates
+ a runtime error if its this value is not a Boolean
+ object. Therefore it cannot be transferred to other
+ kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 09 september 1998
+*/
+var SECTION = "boolean-002.js";
+var VERSION = "JS1_4";
+var TITLE = "Boolean.prototype.valueOf()";
+startTest();
+writeHeaderToLog( SECTION +" "+ TITLE );
+
+
+var exception = "No exception thrown";
+var result = "Failed";
+
+var VALUE_OF = Boolean.prototype.valueOf;
+
+try {
+ var s = new String("Not a Boolean");
+ s.valueOf = VALUE_0F;
+ s.valueOf();
+} catch ( e ) {
+ result = "Passed!";
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "Assigning Boolean.prototype.valueOf to a String object "+
+ "(threw " +exception +")",
+ "Passed!",
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..fcc965cb3d148fd2de8499f1a42bf3756734f840
GIT binary patch
literal 1038
zc${5Q;cDVQ5MGuLLI@#*AR;0`M55=3SEQ8d-4C^C&r-c&Lg6S!*(P%~TufxM*7`X2
z0QWriIyW(`ktVP^JM(=r-^}iKI=}YF{ncVLn~fGfqYx4iiQV}hdFV{{hhGtJ_hro?
z%c3;t-$Vj9i#@@kWLf%~<0uKyQ*zp6&=X9+3Ipvs#v}F^!vzE}<4j<%_1>5A`h>-C
zNw+aK<Ga$~jBr~fdB)PIKFl|9+{<f4!3<W9$Fhed!)JU6qSRUUpQ7w2%{Wej-)F~Z
z-g9en*p`IKgo)s360=PP_GQXfEWX7yR)BNL+LxOo$h$mhxasrVo^u$BjTL|k2yql%
zkglPz0I}ia+<I?-L*_k9^8y~N#o+Z$=9?ApC@7^>->Q$(aCh(di|PEzEAO}?eUYCT
zryn%LZ(?D>O91N}uffY20--*$cmulUPW<Wjxi;HfpdLK~;YTabW<M@QzN`9E|Hh@D
z-?<A9QHDs1w_$_`{x}$%m}{PjRP0diC5vJR4IeTwVHs$*4EqXcXOJiEA8`HG5>Dr~
zC}MxL6WH2?0H<?q7w!XY&{40wPY*-GcEl4$q?rlEMP5hADT+YL-g2DNH(()fKfOtp
z?Rjb+TDFmxZWC(X`wQ1ChxCv39f|6OZfaIlRwPOYC4XsEAsSUBjn)gJN_&N2QAgIu
zfD&9!D^$lH{hx_dge7VhhD^^2L!qs9%^XV#G4W(J2ohwYB54*e4T}!Q>t{=qn%R=_
z5K(ZI5m2ciwn3U*Or`H@(Jt*1nYM{SBvde@q(w+iqAKb(CA}$ANi|O>>B_QEuc}1N
NH^Z{XNyF$?{{#K(F^&KL
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/date-002.js
@@ -0,0 +1,54 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: date-002.js
+ Corresponds To: 15.9.5.23-3-n.js
+ ECMA Section: 15.9.5.23
+ Description: Date.prototype.setTime
+
+ 1. If the this value is not a Date object, generate a runtime error.
+ 2. Call ToNumber(time).
+ 3. Call TimeClip(Result(1)).
+ 4. Set the [[Value]] property of the this value to Result(2).
+ 5. Return the value of the [[Value]] property of the this value.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "date-002";
+var VERSION = "JS1_4";
+var TITLE = "Date.prototype.setTime()";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var MYDATE = new MyDate();
+ result = MYDATE.setTime(0);
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "MYDATE = new MyDate(); MYDATE.setTime(0)" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyDate(value) {
+ this.value = value;
+ this.setTime = Date.prototype.setTime;
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..8133b42fa2f5e2a6954b9e05c83a5d8a623b1227
GIT binary patch
literal 1047
zc${5Q?P}sc6di^kNC+VW5fPCfBGGllc4aBs-5=H3uEmdHLjRQAGEHu6c4H!wvDU}g
zr`YG&H`yDlMw%a!bMHO(+;b=C4JS7axxb!WjK>$VAAt{%4CLngkJ7b=+u$hxF?d}H
zNRl9qs=XlcgJ_=B+M_^%;GrW0<}+qJgO2197T8d`<09aXAzXqNa=~RR>hDv?w=b}5
z9;F?bh=r56*kp-vpNC-<st=P@7`D<`fj5T5<FV~-rs#4p2buXVyU#(AF-sFzABpzD
z*!z8UEc#xlezl6c)b-H<7Lq_n@NqfEi<e+s#bUw3TdXetuPZ6;yLz#|DfGGYp8FwR
zCD3`h&dF*4BJeURt-a<!WUE}6fn15~iZ#a*!BSRTvDvB~3ipmX8&0mB>>Ho3ugVJ-
z8V*>6l77(ObqStSUwF6z-5K=V;dElcs|U-}sWIM6AAcc1-x8)zsylQ?17+H~$z9?Q
z{cbRGu!Dkj#e)$1R+?=uMJ!{vSwj1*O}pi|iEkbX)>`1s-+}ue+;|kv4H@tLCc}k9
z_IUz1iJ(4-t%Dm&K8tuA89vVV*y(&S6Ul{4`G#d<4b~QI{6ufoH!H$mZ{FTUsWZFN
zXq;Qf*c-DO)KYJplZWoTI~xqLi~2`9RYr9~&#PupQz#{blE1X55{>4l%Gx_nWM6i`
zWEI6A9ZK-56{ya1MpSl2%w3tX@(yUMwF3&XPRr(qsicijzC`p2Es;W=Hp$zgXa#EI
zN#3Burlqo3V`+vccxsq0)e)D7-OLd+9j7z)nVk}ib%{bK+GtW@5z=BPPl!qN8g7v@
Wv8#y^m12(M(wC9XlS0*K7ykpKI5ZIe
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/date-003.js
@@ -0,0 +1,56 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: date-003.js
+ Corresponds To 15.9.5.3-1.js
+ ECMA Section: 15.9.5.3-1 Date.prototype.valueOf
+ Description:
+
+ The valueOf function returns a number, which is this time value.
+
+ The valueOf function is not generic; it generates a runtime error if
+ its this value is not a Date object. Therefore it cannot be transferred
+ to other kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "date-003";
+var VERSION = "JS1_4";
+var TITLE = "Date.prototype.valueOf";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var OBJ = new MyObject( new Date(0) );
+ result = OBJ.valueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "OBJ = new MyObject( new Date(0)); OBJ.valueOf()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyObject( value ) {
+ this.value = value;
+ this.valueOf = Date.prototype.valueOf;
+// The following line causes an infinte loop
+// this.toString = new Function( "return this+\"\";");
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..6cf0b88d7689076cc23b6186eadb5eef8b11d435
GIT binary patch
literal 983
zc${5QVQbqk5EVigV~jB-git~eSqN#Dg=~aT*6l-*x?M_>me>?V8AY{kiJ4;?S!tSI
zvfs0RwsXD4rC+SOcY5#Moi(1$FFkU1u^7!}qs7lCghWMZcY3W2y3^<6R|L|1$|U4@
zlqRill!Q^TtZMzMNP!fwrzGOl%}y11N+?((p>r!_BpzZogCG`CC@i+$VySFSL>yOi
zjy;9kRX}%y$1*7tE3j8|iGmrdA6^?a?&q609##xr$R()CzcG%};CItsMR~<Kn8UWp
zPF_pDRpJPMR1o4EUXW(cINu~eG1)i`ccvG}C{rz8?j}M7tNkkYc`DZ;zQKvtfD6of
zFFJeZS*`P;_G)GIXQ@dnHaXmR{$e`6@Ty<;j(yc0g*4IpCRX&l<+&4odObJcDT6>c
z@DxB+$QX|z-hhQO_|Y27*^jf4@0zpS8Co>_sek2Cux{Ojhh*c@`*=U>6{UVAQ<bV+
z2L1n3J4E=yU@+uciI3qsh!CWoUZqR(TtqR1^hht5l-s<kRuZ<{*^4;25>ok)D_f=I
zBeIKZB683b2Ih^x&4itK%J<ees-)XwUV7%=c!HXx^X}0pFX0z^-J?5y;kwm^{?ayQ
z)UhpFt2GRrQbH*CLmN6VsX;Y%SOyJtPzE*D)J)Q+1i!paEoL#Iu`a2VWy)G*V6c-i
z(Anosqc&hVaWJ!+co5C5Q_~@~MNz5VsI^&v5FNh;;`ISuX_8OJI?;*-7Gq!7F)>)1
o=!9b9AtgORju|!4ZjCx!jZ(ALqNIaDhX*Dxi^Fmp(&<_M0CE{0WB>pF
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/date-004.js
@@ -0,0 +1,50 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: date-004.js
+ Corresponds To: 15.9.5.4-2-n.js
+ ECMA Section: 15.9.5.4-1 Date.prototype.getTime
+ Description:
+
+ 1. If the this value is not an object whose [[Class]] property is "Date",
+ generate a runtime error.
+ 2. Return this time value.
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "date-004";
+var VERSION = "JS1_4";
+var TITLE = "Date.prototype.getTime";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var MYDATE = new MyDate();
+ result = MYDATE.getTime();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "MYDATE = new MyDate(); MYDATE.getTime()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyDate( value ) {
+ this.value = value;
+ this.getTime = Date.prototype.getTime;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..484c0c204b6b0b48b846ce009e8341496401f7cf
GIT binary patch
literal 878
zc${5QQH$C@5MGuggb;#+tH>e8A`+~%R^jMF`=mBrJ=7Kx?nMsSOIFQw&B|sy&;QXs
z+qX`%XQV7FGvCa7GxP2CN7MTN&F^Nt$)q=XOk$quL?6EXA+5&f=qwYi{MW7GS(eDu
zE6hMM%{P$J9w(YBCIYRJbX6o&2TX{<wHDKz5VW79OdSfi20#pTMYr1?1XgKI9Wu4z
zx(GFj&;@Z{$mm!7fvJQ&3I2^of+?n@^8SY)`FhItMQLTYOQRg_%lOdBH%g)j-#lHe
zOra-Nn#aHvL~_gRAX3Rzd!afEVHqI~XDR4VstprAq1lFmC|UELHu>rWWqH7Kv>phy
z%eeP8!o`sDAe@b+cR}$U??}f9{6RSSF~uLOa1@Sx<Ao`gzeaqUm)N=3i>?hFc0yy`
z*)kYA{z9o<E54`aMCZYu1wcdS<MkQ**y(gJH8sz)n`x$W2$uDnbr-khgy}WiE7;>Z
zXE9fy9LrTJM;q_yydb7YM%Q^=Mwe32d-lRkLQ#+>jhTw6|CXD<T*u#`lvE`xPhaQr
zk|iRaIh7Z*Fu&ZVxK+xz2Q1_BaOV4kGy$eJ1Y4$oh)Xa+7=6N}vSH&Z8<FzKaLLWd
zAjHE4s$v9pt&A-=2$2dR;9E!Z8lxscrfFMsj7;!;8@S}yqzSj_)m+oTkVP?S*p6#@
j7+bA8T!N@kMNR`F*KA{4LG7A}P~L#lkx8yd3E6)EN0STH
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-001.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-001
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * Call error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-001";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: CallError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+Call_1();
+
+test();
+
+function Call_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ Math();
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "Math() [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..b35f58ae3d36c299488f6b16784e561ca535fcd9
GIT binary patch
literal 894
zc${5QU5na46df)h1PLLC1QA&VkzlR0Zn1sXK53fWx~MHCEEHK}HW@YTn32i2u79Qf
zv~Qhg*GLIW?#H?JoHNOAG`$bd{BAawOa`;ZB&MlM<l*xlt<xGElVw7M|FRV{%MzY;
z$BCqZut16=T@`h=2m?tZ-Kf#hV!C6j?h(d{ZhxR&t2FP2M69SRSnx1Oi8vJ4hAPC0
zrhv4H=>pb#AR-}8jDDdJBZ5dS-2Y1oRvI!M{i;prz8J-79~F|u3Liv#OWXha<;pK$
zw_I!p`>r-^sOo2(++-3>=;rD2cHB@LZj}kf4(D5NJR+mD$H*?D?(Hs(axE9K%pelU
zR#snILmnUIK{y*t?}Flcyw`eG;Ctcd+Z5iKif+ebnZ87Hd$bmg!m+PE6XAF~&7{~x
za&g_;66G$w!C0;Z-QzPHsP*8_0<{b8h4TBAl9-B+kNK*cNg`xOGr7%=3@^FB_vD$J
zRAOZ-jfse{|GF%@!Dmii2ri&g`k7rX`k$60VL5%u3+h}7->3al>6s9@ZoR?ti*Ax(
zBQM*MpZ+jASK*P2YWNYbAyrm8!{7CKALilA_ltY_0j-(_rlBLFtN}uRK7w5-nNYS6
zbWcGU>Zibfs%9VukUA?4nCejzZDgq2JXSk^T!eJpGOqyXZ9u<u%`RzhrB1!xaP$h~
pc@;GPH7(oGUC_*0j<6KKz{qX_a`Y}Jh}$p_$~gcd9a>-^?Jvzl5-<P&
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-002.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-002
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * Construct error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-002";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: ConstructError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+Construct_1();
+
+test();
+
+function Construct_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = new Math();
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "new Math() [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..5b70c25eab10bd590d5bc2c8de0b8e534abbf656
GIT binary patch
literal 1056
zc${5Pk4xJ?6h0mygb+#y5~RpDiiGOAQniTaHfFo%D%y=E$e@Uv$+eBU=DN$(+COCf
z+WwotE{!%t0+;vR_r3SMADv$RDnP@_!THV2`QR>zX(|)BJUh~x_1?-EB~<v&GeNT~
z;c4?akyH>CNRg!DGVYaTAc>??m5Mt_O2o26>gVb=PIIgb?sN%brEA{z=Zv*WW=O=C
z%CeW5sv0ZpGSbKuljw#{A2wU{Ziz_91EXJQ#E4K7RlUP_^lSGm!bP=D7iB6|@>EC~
zD`F7w8O0Y|ObPp;$Wy8okZoVg(<ral;qlT6B9Y9b+a)rZbQzgv)O*D@#Jx}~FVspH
zTdsF>vf2CFq4!^woo}RUZWx4vUjH&EkM&Rc2=6O_-wk`;`?lo8aV*83Giips@Y=Vs
zRm`E!5uN4D*oDOXf&N4U(8{ep2vl}!M%3u>DaLXl=mM|#fZIh0{0XNDC^YJ|NmAQ8
zdkkqNGd$t~Uy&zLtV2;q8WRy?|FuYViVIm^2rdk%vg|yyOET)r1eaVcXVfZcYm>x$
z%nt6`cp=mtzEKiW5%Oz3*6`iWqM7FFu&S#L=ZuoHxvsMYolFuTbD`>bo)4|o(ea2R
zEFU)I<)HcCe35qE2-NrRaD$X&xbh+hjbS+O{qh`tpthqy#n8dn(f|;k-(YXq7Hr!9
zhlQ~P^};Y<M>A0ikb3uB(2<T1z&0|JUs*-p0rC*CEW4sC3j_MAYeq$fwtB5b-L<~t
zzF9@PI)JAc`^eNB2c6V3&2*FvXxDaJ%L7e6>H9rT|9)uJswTD#C{bS}ErrRG|sS
K$btsANdFK0{YKFM
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-003.js
@@ -0,0 +1,49 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-003
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * Target error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-003";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: TargetError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+Target_1();
+
+test();
+
+function Target_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ string = new String("hi");
+ string.toString = Boolean.prototype.toString;
+ string.toString();
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "string = new String(\"hi\");"+
+ "string.toString = Boolean.prototype.toString" +
+ "string.toString() [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..16ba4e7b9bf7430391cc0ab79b27f1a2d30a0828
GIT binary patch
literal 920
zc${5PU2Eb%6df*MkPsw@NRd(oDI(StySV$%eNs1eE!Hk36c#CEOh%jTn32g?>tESl
zyEnBq(wE7-C-<ClKl-D|jZbFR)86fEZ~72NA~CVq{kWj*#^^0s#6o+oYc0|=R!Mst
z8=<-MjgFILj@R?hH{6I7QtijdM#^pv(PfeW0oO}ma@krxP9l`akw#ve3!V<RlzGaK
z#r5vU`=0BV&!zY&Ldi8Zh@F4Nl(zd)g@3CPvCXNSfm*FMMntz_H9wy7WVlJfOsKD-
zUGshDY@8$8L&=e?<A*w48#YvW#pQ2AR|2VND_cq&es-w`dN;&rq}+XMjo}J}#+Gmb
zKU8Z`8E_Lm4J6;BV&(_a(d63C4|QpME&ARd7~M@ARNY7e7j`fT#vXm)x+GphvCcXx
z2kLJAEJE{m*;#Y6h^`njPg-o*M@{kGoBAjO0$RXaqxM%W7?GMJz$ax3rP&RC;qP-|
z*Ga^6#Jqz>dc_V-p4Lj!g;ExK=;CKqn{!=zV6)tj#VPx~;IYiwNz~B~Y)x$w`#HUQ
z?7ErvfTyCA8m>*2v8~3N{1QA8I#6S^tbS0xbUIy%PP1U@dHJILK&@$kQ=o*p77zmD
z8@Q!{17({)dmp$^-v<;<ts-dx!M9Zb*K#dnR0ze~c|)r}7$KC}&N&cz3gjQPoC3f(
zzV=z8Ld%flRdNQMmR+jQI#_Nwt0-bYu}(@SKq|Bi)(L6U3WQ`HP$M=lC=&P&giafB
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-004.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-004
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * ToObject error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-004";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+ToObject_1();
+
+test();
+
+function ToObject_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = foo["bar"];
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "foo[\"bar\"] [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..520a06fc97fa7abd7c81a6589748650a1142bd87
GIT binary patch
literal 920
zc${5PZENB{5MG9`gdid!QlykcN|4qQd$j$~`&7NOXR-D$p>RkkYqHw()~sySTK~%Z
z+MCqYEoEVtmuH@NX0|sN-GpRvJ-)oXy&ONJiO5W9Hb0JOr!{yBW~tD@>r#t6PgT|#
zrbcKkL!;AdZu7o%L&J?&V5|2yT1mOz=Th2gvzKNGwp#MmB^Ksc(P3c>VO(!);?$xd
zuIIv70{@=tluxDjDPqYrHwgE7QpJA{zgCpqyIN&&f#|7Z(-?`h9dY!&TcO%!yM47-
zu8c@-#bWyT6buy!jRhPM#%d}259&`k+Ql`}_-k*y&rST)mwc5AKhm2k+*ZoX?sTOv
z*6Gr)E2S4){zkHeKyCRXjK+h}b!b28#Q9zhgMKu)8^Li2=~vQt(I6TIRq+~&Wg(&#
zsk`a3h|S{(ec`%%AB;o9cb6PDNG=#NPg<<m4i5s_)!cAxB9R;KIX`(krBkkfRgBvH
zJX>o#)-S;mp(8a^^GX5j^ISOWfzFh24aQlK%-Kw7cEexz`%<`NmT;Z0;A3EZ!9FAg
zS}T1%<Ebo^Wy-25RH}7$isX|fs%bv3$){?Xv&Js^*6p56qHz$|L;Zmx=78r?Ldy;i
z0^|%T)lv!S9)a%GDZ}2@p>X85qz(ivt3w$dcI*?1vG<m30cjFKspqwU&^;jks8gyq
z&_?U-w`#NoMSMVfX!u^WMtyL~wE|H=fO|-)2S94H15Sf9n=T>64CoLS4xvJv{~pU5
Aa{vGU
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-005.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-005
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * ToObject error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-005";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+ToObject_1();
+
+test();
+
+function ToObject_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = foo["bar"];
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "foo[\"bar\"] [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..440834c90fdde966d8d200f12bcca3a674b60dc1
GIT binary patch
literal 1071
zc${5QZENB{5MGuLLI@%vA|hpxB3|o>J)|7HPt{9%mTHU1^^5e%HW}^q)~swc+Wek=
zx&Ly1>NeUMuL%tE^32RLPtqTbuRJupoSctF=aYLDLZp~VzrC8h)^HQd7)bYJDIt!T
zh?=?UDXL(hA)RZcKvM20$)b4<uph<==dE)c%%cpLmq?#QRHk{Np%bC*&Ue-al=B?W
z%g6Xs&OznK!#gS&edO>R0!}4WLfU;Ug5S-L1wE%WhV|Y#7fBRk={>~3&;O~_{U;XZ
zVfXFYak2o(g1qoG6NCjLSUiIK$d+6PxuE=3?^uBDkE`#S`yxy$1FC|j0jEg}?fo(N
zbjJ%MTdJln(+jN~=jl#=qL+bG5bATiKrG>CM{!@lspn6I<4Z69$cfP_c<#U--i+~a
zag^RXK0}}!jZe5L!Ak(kjby&Km2ANjTfxJL?GOEH*IZGFp>XF;Jl$=r1Pi-Ms(FNG
zgs3M8YqIMvDzW`F3M<MJxS83{@ySE4wgY_bc25m*Uy2o#%7<9ZG82=TkmQQ4==OA?
z4~{}AL*l+S#%IJ&m*7e%WHIX*&=@SGozod*JR=i{oJdAYtRvheYpE6b0W<{Zi)%6e
z6=}ln0<=DnWAY&}-J8N<g2~jMxNa`xU)=7RhGAPKa!T4k2%}eAsuUbta*%PbbxKBk
z>o~?CE}#ZR+IA|~)-OWF7v$*J-eg-C)ethx42jGpMtuWYje}~vOwikt#kIY7i?`qK
ze@tu@P2)&g>r1C>HgFc(xQYynHm2ni%NmL8b_T3yT;T{6s~DBd4%WD4!$K&dW^|Ed
I5Tk<3f2FWPt^fc4
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-006.js
@@ -0,0 +1,56 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-006
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * ToPrimitive error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-006";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: TypeError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+ToPrimitive_1();
+
+test();
+
+
+/**
+ * Getting the [[DefaultValue]] of any instances of MyObject
+ * should result in a runtime error in ToPrimitive.
+ */
+
+function MyObject() {
+ this.toString = void 0;
+ this.valueOf = void 0;
+}
+
+function ToPrimitive_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = new MyObject() + new MyObject();
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "new MyObject() + new MyObject() [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..047cf0f4b703adeb4ee5add2929ecf8a49130604
GIT binary patch
literal 1101
zc${5P-EP`27_}@bLQxbUgb+fgvQQPVmLb})uIjD|O*^VWCzAFCZIzoCaAy+a7%0!P
zoAr72LUZ^tYa&_S`FxIje7;tvck6+{P5-jnz3l&BA&n%H%dfwUX0@{dLq>)BIu$fY
zSR6UJ^dymVqA2w{CaECYlY&JfO)#H&GtR4*3XGzZsJALD7KMteufVE9#8OkrZNj;R
zO?`|{#E42QE%oR^6AvGWVC0$8D;jVjh>V5vzLlD5@i_S9T+gB)g?l^2ZLbxF%k%V=
zEa=k7GZpVG;OkgS2>-5x6RILe%Kn%o+DdI-tlO3s2sV|DFP7Kp(VQ=LQ5M=n2IDp-
zvxGJ_vG!&YDp;WP2M_-zg_SQVBn{Owy&#^_qn&a;!GY)ZJG~oE5BUvUWV_4z=NB4C
zcx-!a+wa`>EXAL3Y0QZzU(q2^^&{ak`gD?`uK}H|((^n1oohe3eNQQ}GG5O<*Lt|=
zJ#<@cAJWE@C|ltL#&Rs^0`IgxBZaotRzKil{H`(3T+9-jku;I^JhgB?G+&aFr)Jhy
ztu{$0!aqto^2bKwi}mT`{Pc4JFNBKV8zmtXetZ{?&W42X)J+ucovxh4i^$p}P|M6?
z7D7BuPfzeL7WkIT$$DB?%_s_q2(i1BC+cnfa!OqxVv$QE5i(T{{J!hzkpDubVIUKj
znLM(y1_B5`@CNgRj0N*1Le9F#BD^kabha+?s0wXx4uM*a3eZwNK&T09h0RsB3_%G1
z!!QAcz)<K6!OTG=S3j+R&6nbX9H?)Z=7#ylfEi_`rdI2;S~My!#TLvd30N&hW}#>}
j5L%6tSX4aw5EOC{6pcDmyh<elP-+U5fQ1fG5g7jf@6=0h
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-007.js
@@ -0,0 +1,57 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-007
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * DefaultValue error.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-007";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: TypeError";
+var BUGNUMBER="318250";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DefaultValue_1();
+
+test();
+
+
+/**
+ * Getting the [[DefaultValue]] of any instances of MyObject
+ * should result in a runtime error in ToPrimitive.
+ */
+
+function MyObject() {
+ this.toString = void 0;
+ this.valueOf = new Object();
+}
+
+function DefaultValue_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = new MyObject() + new MyObject();
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "new MyObject() + new MyObject() [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..0310a70969c17c3070fb3b85af2972596d121fb0
GIT binary patch
literal 965
zc${5QVQbnz7{0xP5F|(lMMR_=L4xa?*ip)8zpT30S*jZ*^ox{oO-`Hc%*o}f`e}b>
zKXZ3ljqJ;NcTb-8d7k$!-NEQCM3dX`&2V@#eoPaZ$y9Exhi0ca*dC@S6~THTXr8A$
zYu~4m3c^Au(ri}Xez6TDk#w$F>pj9)f#YtP5wR(NiyO7fGEI$$m{D06dWxGUg92$5
z<U*nJG+HuN>M|bxZaff?l4nN0)0h!KBp3ewkWQg=sE{;K-@=$Ls2#>4T}VF?o4yLj
z*yb=mZA4c``TJbV3Hzml=2Trm-q=fR{kLM({xXZTO_wK|N{`6+rN_uJr>#Br(7xsS
zd;U?vv-d03qZRHgohprobpCw&9+NN{4@S3P@p3)mOF0aB(ctIER-`49@X4j?m@c$<
zDH=rgf%!&+6K*m|)=%f11yR|OD~#ofpeuafmLGy~sAPbCqi=*Yy_hSDY)QS3cv8@C
zn&Z-Ie*ScUS3*VqK}kYI#P9jck$m@~)DG;=ozB<GDM^`j%=nRva_6hez>lvH&1H_K
zT;MzMMt1Lm)%;mPM1q5TM}CEOGXz3#;pna&$*H@Kd2LArLCezV0lT>*LTc6|8V5mf
zV}GDlHNdt^WH|<)4}d1%R7y6S*a+&ojRTe4#sbeUQ3sH!)e2aKWgrA?WT~^gMVo-m
zkgiIqs;gRU8v}A0fc~0Bxdd>ks@bZ$-aAW!CTf`gzHhs(<AY(HX<}LN%r<gsfLx~y
T#wlue7DCz<PLK&0$_V}e>QyFx
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-008.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-008
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * SyntaxError.
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-008";
+var VERSION = "js1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: SyntaxError";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+Syntax_1();
+
+test();
+
+function Syntax_1() {
+ result = "failed: no exception thrown";
+ exception = null;
+
+ try {
+ result = eval("continue;");
+ } catch ( e ) {
+ result = "passed: threw exception",
+ exception = e.toString();
+ } finally {
+ new TestCase(
+ SECTION,
+ "eval(\"continue\") [ exception is " + exception +" ]",
+ "passed: threw exception",
+ result );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..f49d87a51d4004d0d45b5ac2e03aaca0ee5451d1
GIT binary patch
literal 834
zc${64ZEM>w5XXfuMi>)<3892gL<lDAp)^|=YxgS7oGzvHM(lPk!YHbJNxdm{kd-E8
zA7&qMUt#BFt;gP+?oPkE`|IRQgNu;N&u62ntI_ORnn0#gU4Hmw3<lH3V3C6IcWVVj
zk>;6o8*HSsJekKo+&Ud<p<#vi(PgSZ2^ngYX3HArd1;nlrtaz92$hOE2_GSrLJ5sj
zcPyl=i~9c~xoVGvj_=1(YzpAmQ>e1$Peynwvr0!K)Dm<(ZBSp;yc?-<f<2@xpC7;x
z1f?Ot*<qZo;b5}K;!2#CC#Cxo{3F^9W0kHopX6#K<QL4Y0C!My0@&8G=3z9O2IpbD
z;@|YR5&Gk3`Z+KkgtB3`hFDwCG`jSg0Tig=c4%YyMr!(!g5zDE2iI4gKWp6hvk=Q#
z*(1fZD!)hQ7JQK_ejy&jUrG3?ED<W<{w{`fCAK)@VVP;M^Oee#Q)r=dRoa0k;`Q<I
zX?Gz~3CS7P_X@V0^7m_jYrzE1a{i1~*ZDT1cYLex+dqLwKt=gwzNEr_JA8Bc?u2P<
zZe4`K+mmKBXDkYsM>F5A_wbYUx&~zyYZB9;gi!L8IySXw(;}?1cO3R=@0hH;cbaTq
zHpl@bX!~v2vRgJG?2wopgSw`9&^8!HYY_thMu}rJ4BDnus%5h-!RU~hE;(`-*0qR1
fECgRr!chUWSf3IEh)1zsuQF8&w>tK2@5%iGnk@3(
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-009.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: exception-009
+ * ECMA Section:
+ * Description: Tests for JavaScript Standard Exceptions
+ *
+ * Regression test for nested try blocks.
+ *
+ * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312964
+ *
+ * Author: christine@netscape.com
+ * Date: 31 August 1998
+ */
+var SECTION = "exception-009";
+var VERSION = "JS1_4";
+var TITLE = "Tests for JavaScript Standard Exceptions: SyntaxError";
+var BUGNUMBER= "312964";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+try {
+ expect = "passed: no exception thrown";
+ result = expect;
+ Nested_1();
+} catch ( e ) {
+ result = "failed: threw " + e;
+} finally {
+ new TestCase(
+ SECTION,
+ "nested try",
+ expect,
+ result );
+}
+
+
+test();
+
+function Nested_1() {
+ try {
+ try {
+ } catch (a) {
+ } finally {
+ }
+ } catch (b) {
+ } finally {
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..10a6b589a020dda0a9f86109d7721708280bc789
GIT binary patch
literal 684
zc${63UyIW~6vf9Ogc3psrIb>NjLT9N|CHS#$gWRqI@U-VmrQmMipZE;lR!+$WZLe2
zSzr7bg5GS!h%Ynup8W2an=|)=_kwJe;cUI0g`e^SN}cQbH$UibvdT3mSqQE2GUaz$
z1$CWQ<(dBgea%6&;<zn^mKwexGV)|mwED?BFB5cX$H%u)<?>4b3y2G;q(<uWf2~rl
zW;magjb$WN3c7V*=qc6xKg+djE7~Gf`Bo1DIJ6=|5|oAn9~5!5g^h?pKUj)3gkSW9
zBe)m&9|9}#qZRMzOjQR~?ux?NVk+9)OXb}1P#{8|TcA{>DC=mbH4Bhp$APAwbZae@
zj<9r_!;>|1U@r@HP#E+(kO`=$T2(2V-z<Zh^_+)SY<ltf@^ZSU%BPxnO4ixY5o3JV
z!sQ>YaY4Sw-p>3LUp%>DBCB>q!ZNuB26yP3utTmhwku<~OEZmP4BIB^Nq@nG7y8%D
z4-WszFV8Q|ZSJjSpQoEB<h;$}XKz4B$0XFE<Pjy`2Uf?Xc88F&V_}hJhDrOB99v2l
ywxd3EZP%uRxRhdVnw0eZ+>ec}GbRR}C&V%ObTGmpVi3oqL;P$Y*2U`xpZ*4!7tPTC
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-010-n.js
@@ -0,0 +1,25 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+var SECTION = "exception-010";
+var VERSION = "ECMA_2";
+startTest();
+var TITLE = "Don't Crash throwing null";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+print("Null throw test.");
+print("BUGNUMBER: 21799");
+
+DESCRIPTION = "throw null";
+EXPECTED = "error";
+
+new TestCase( SECTION, "throw null", "error", eval("throw null" ));
+
+test();
+
+print("FAILED!: Should have exited with uncaught exception.");
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..799a208bf4034cf0f44cf2fda8d28511a72b697e
GIT binary patch
literal 689
zc${63(Q4Z;6oxfnj0whsP(l|%(Mrj(ZVT<$)wUbg(K?SLE0$LVVGK1swFRDSWF=`|
zaxbylJ;Y9$QNeCxo%4S_|IvRDFFp&hyiCIRJWRf;3@W3{{rlf^FqtU>T9(3SRptDy
z(a^T4uEy~LbgMwy=Ez=!kp_MuGK^$d+WyJ4)JoozFojhqwKTOJ{og|D_(D|~8d?{I
z9jWi_q_-h{@@nUiN}YqT?AS_{A1q*ND~1SY0~wl&Ro#FuR$4V?DbgffTnZb)Q|DD6
zc$CIp7VbvsP8z2(-T|#^ePjw<Z`r!a;8s<Tbs7xG(3inAPXzK^{_P6?<WtJJDYPb%
zEfgQac*dvC-Z4?s>oQ}7+yH|+j5%XlWeOa(lIy%M*jz!gOJg$J8;v)$%GlY957WAO
zZdjycTd)TSqq1wTt;T7eKxUxRdRFJBUmvCYAcM<HdaaS#?DpzUxrmbZYWGGDHnQ|~
zz~IsU_1XEk&!c(x<IOTnIJe>aIqXy7xx@)5c|ysreuw(h^9dR6F9A7qT*@ffmkt?V
vIqcKG4}3~Uk2+X)TuP3dUiX-Icy@{F9MFTIhq^~xm!6<}h}ejde{laV%}~=r
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/exception-011-n.js
@@ -0,0 +1,26 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+var SECTION = "exception-011";
+var VERSION = "ECMA_2";
+startTest();
+var TITLE = "Don't Crash throwing undefined";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+print("Undefined throw test.");
+
+DESCRIPTION = "throw undefined";
+EXPECTED = "error";
+
+new TestCase( SECTION, "throw undefined", "error", eval("throw (void 0)") );
+
+test();
+
+print("FAILED!: Should have exited with uncaught exception.");
+
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..feed6dbb804c1183a9cb94ecbc12c2468a2a4220
GIT binary patch
literal 843
zc${5Q@oU;Z6uuoHgb;#=ND)_#AYwZww(AdLV+?g!XVJ7IK|0)!Yw~8p&O|O}t$)M*
z>0J`$l@YjndGCAQd+*DQr`}C~me>AhJ|Fo%lNeHwh{MM}T6Zu@1aQg%!IO0DK5seX
zd6K2QX-WE(09V1Tf`Om{Hj?6ulQfp4ir-mKp3nydUm#+XQ<3rR{~@VBWFh4TCE1=(
z#?<H4NWRu-(IcdM4MKJ3sg&ZIW0pm~TORCHtRsoQ1;k}8h_Ws8i^-E{4x5LUtC=fr
z$CwlH!-R_H@wguOryw^d>#ZQ-$yPK=+Jw<v4$C0)r`~m-jJ?$^^(V^ln>sv4ur1cL
z19uWmZ#_#k+%aK>({Scuuotc$6yZB68^!M@nRK(@Q$}RB(mm26pUDSuhKb!1j~w>I
zya_H=SG5pwF`+qFUunW1HsFb}n#ihuiO+t>5y<@eYBBQ3CnER`q>kg>-}x6#zXF$z
z6fV&_r=APSMWIRdT;7UrKx5!xHp|xcQMTDo0!O<@k`hXy7sKX9$J&bab~wB+gj5`O
z897=(_B1DQk!+tXL*I3kZzJpwj4V?(ZOy>w6-KXd!$cM~bRG38V55@?n5eGVxQmfI
zdrfS~2kWST%_?o6b_FyvJZ+p{B=zc8a!+-PIvw3=v^$zsuNkN&Pt9&&OZL{9xOHw|
U-759aIcj1JIjDvWSvkPyFEcgzWdHyG
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-001.js
@@ -0,0 +1,50 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-001.js
+ Corresponds to: ecma/Expressions/11.12-2-n.js
+ ECMA Section: 11.12
+ Description:
+
+ The grammar for a ConditionalExpression in ECMAScript is a little bit
+ different from that in C and Java, which each allow the second
+ subexpression to be an Expression but restrict the third expression to
+ be a ConditionalExpression. The motivation for this difference in
+ ECMAScript is to allow an assignment expression to be governed by either
+ arm of a conditional and to eliminate the confusing and fairly useless
+ case of a comma expression as the center expression.
+
+ Author: christine@netscape.com
+ Date: 09 september 1998
+*/
+var SECTION = "expression-001";
+var VERSION = "JS1_4";
+var TITLE = "Conditional operator ( ? : )"
+ startTest();
+writeHeaderToLog( SECTION + " " + TITLE );
+
+// the following expression should be an error in JS.
+
+var result = "Failed"
+ var exception = "No exception was thrown";
+
+try {
+ eval("var MY_VAR = true ? \"EXPR1\", \"EXPR2\" : \"EXPR3\"");
+} catch ( e ) {
+ result = "Passed";
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "comma expression in a conditional statement "+
+ "(threw "+ exception +")",
+ "Passed",
+ result );
+
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..665c34b6a35047ce7b6cf28c945cf46eefa58320
GIT binary patch
literal 1174
zc${5Q@oU;Z6h4k{gb+dqA|fJ(h}f<ZS7elJjH%UDu~AG~7-f`e^3-%Ok;_@@pR>PX
z|J*KGP1pR8`|iE(z4yH@=?v_lgYK`U?VFqS^jF|RBm%Mh`iHdYgWY8o0Pnr5I3!6B
zN0m+x`9U<#a<we!2qs`D6OB<IfV0pMTyir)y)BP<lv1)_?T+z)J%(@zUdT8TGFE*b
zi+QQb!Z53%QV8SQETBEu>o6?2iy+B@t!$vn_#8y0`yy2vcsH<o1pc0O_BNTdE84Jm
zGqDrK-tXq?uJ(EfJn*u#?sz;{iCTXhdFf7X*2{O9@D|;WtrMuYe7n0I-J?<sZ~?wF
z!SUi16b>yqvA;b#WGAxO66EY1hxTK>WZ^NGlyCp{=iYIr1N+L!zVTnhCeMs(&n#R6
z{-8_ZIusVXc(6*R>G9(ectVGll{^fm*L4SDTTgZ$Rgc!GH|B)P;aqGrci@hC#$9jf
zq@;0YDCy>8I-c~V?oYh3){zghAOhdm%^S}!===XepD?+SuL?+nl?cX#D^V4W(vy$P
z=6T~OF-5$upc^htzXs+5cjHk!$0yZ;5Zd-USr+p|Yje)F#Adeo90$JMXF&+QHgrBc
zv}$%tkBd^V;PEC}T!D}f=uRMwXOu;B?*ZK`;^dGB5_(*Q8g*F=8)~MSyDR}rb$e&c
zy*usoGPiG)%Bg~LmRU0L1ywH-j1WdAN?AiX*0Dhvdr%-h_8?C_D+W5xV^c8|WRM}s
z%ljEd8nR@%R6-XiE=pXc==D+5e6fUbRh7{5Z^tO1=*zw-A>a2vC7nIcNxfdSN?2AB
zqga&vDj3ypwQN<DG=_BfR*fR6HZf94==xMeMk>iv$R+6`m9&tKh?I7UQ5B(vrdpbb
p<#ra%H7ylu7-JJ#mQ-%5idx8NNJ|gXKs9LsPO)X6(E(Qw{s)!vQpo@S
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-002.js
@@ -0,0 +1,60 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expressions-002.js
+ Corresponds to: ecma/Expressions/11.2.1-3-n.js
+ ECMA Section: 11.2.1 Property Accessors
+ Description:
+
+ Try to access properties of an object whose value is undefined.
+
+ Author: christine@netscape.com
+ Date: 09 september 1998
+*/
+var SECTION = "expressions-002.js";
+var VERSION = "JS1_4";
+var TITLE = "Property Accessors";
+writeHeaderToLog( SECTION + " "+TITLE );
+
+startTest();
+
+// go through all Native Function objects, methods, and properties and get their typeof.
+
+var PROPERTY = new Array();
+var p = 0;
+
+// try to access properties of primitive types
+
+OBJECT = new Property( "undefined", void 0, "undefined", NaN );
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = OBJECT.value.valueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+
+new TestCase(
+ SECTION,
+ "Get the value of an object whose value is undefined "+
+ "(threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function Property( object, value, string, number ) {
+ this.object = object;
+ this.string = String(value);
+ this.number = Number(value);
+ this.valueOf = value;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..d5232138d3609722d7c8dcab1f644eddf09a1137
GIT binary patch
literal 1128
zc${5P@oU;Z6h4k{gm45A2~I=~5pkUp*U2c`7*ngArA>>;`b!z*n!IYdn8@X<b^pqK
z+Ml@pU>8$O*Zh!s_ucos_r3Q96Z_Ob*C*5d`FVf(Bk&=Tf!uuhLwc>r_Hq}17(Ffp
zBuNlQ%{+7@m#|Qj`XGq>Ae!a;&RHNq@X(P$;kl&MSH~<$MLAd<@-Tc>;fjlZ--d7u
zUdRQP3TwQ?V!>2VE;hNYm*;l5n1Rgg9HmwR?;IAlAYRgp8+#RoRd*gFd9wC%MGhN-
zF!p{{Y*^=5dAy3e)Z`%cH{GYk?bQNA;N>i)%7T#Kt4<s*UP5yxd)8)qN4iwN0#v3g
z)f#f?&4(dhCBVk9SnzO9Nb0WGY~T0msD1x`Fx2rxu$0%1JDu1kPQK&c+SqvD;R?tD
z7gVuVp~P>B@aVxZwL{@?37(|!?Y%loXEbyt7k1%NC{IFeXtLd|;ZEGM5sg;qsEVt|
zhr1vGA45UL+5YLp;8bbNtI^a+6S$DbAy0sgc@To%*d=6r&r_CTk^DLV$>bc^E(P2A
zWbqy25zG9r^*mPd$R2`(?JG00CFcUxj6P}CLM`PRa36#lpT#q3Z@ubL`5-p8=_OZl
z_c1Fbk_(yIGftg%H$D9!4*Uk}Cz-tMcHejIlcpWB{gjkX5w9cs`r4h2M)`DKX@?CB
z7ffoFm~LnoA&maw3dIzgnn}K90VAKYphTM3KphJgNP!@e9HElBf5Zsu#aay&8agR=
zztqvwN6M&|2{qEl0-X%9z#tzwRjZ1XQZp(QR6|va4zx<uQic?U4E5KI3aTg^*HHaH
zM`l{KKuC)mAe|f|18J)KAx2GvT83`XqOy-Ht<Wy&8r6_i)GUi(Wb0Tjl_{d>Q8ZAS
Pq>ZZBGEjFHE5H8$3Uf@b
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-003.js
@@ -0,0 +1,55 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expressions-003.js
+ Corresponds to: ecma/Expressions/11.2.1-3-n.js
+ ECMA Section: 11.2.1 Property Accessors
+ Description:
+
+ Try to access properties of an object whose value is undefined.
+
+ Author: christine@netscape.com
+ Date: 09 september 1998
+*/
+var SECTION = "expressions-003.js";
+var VERSION = "JS1_4";
+var TITLE = "Property Accessors";
+writeHeaderToLog( SECTION + " "+TITLE );
+
+startTest();
+
+// try to access properties of primitive types
+
+OBJECT = new Property( "undefined", void 0, "undefined", NaN );
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = OBJECT.value.toString();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+
+new TestCase(
+ SECTION,
+ "Get the toString value of an object whose value is undefined "+
+ "(threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function Property( object, value, string, number ) {
+ this.object = object;
+ this.string = String(value);
+ this.number = Number(value);
+ this.value = value;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..9d695f84367afc1786741678c36c53488f04110e
GIT binary patch
literal 1112
zc${5Q@oU;Z6h4k4gm8o)62yrdBI2AAH)ND;jH$DorA><o{iTd@jjx(5=HznL`bX`L
z+kdc&sirhP<i7Xr`|f-1-HoQ+xsPtoX2Z+N;p|s5heSnc_vNoKXixXSLj-d2w3d*j
zkw_Y&D49peqS)(QL<%I2eI<3iV73bAE3ROr1?{1Z7fA+--R2FK5x<Y&2ZS+~TnSkl
z^EiHS)N6*$F<l6kyMj~;mQh-SCz)v!Uc%}gWMLa{xd3I|d7C&MyiONQbziEBL#rNa
zi^v+qBK+fyxeAx#m~T>O1ah|zj~#cOr<3^=O6rF)TC3LSCJD1<Ui8&J3RWPau+VgM
zwICJDuQhW8n&gLK4eV6N6_1a}lpT0_XnRKG;4%{P-K`(Yrrw!f-1Lf!tVbSiz<A^m
zzoXi26D!-FjDzWwSAwSy)|r~Z(;7lW#r^MWxf-2ohI1{ogH$^!m<AUUn(iL~O*Yxw
z?3>BV*Jn6N<d4Hl^b{~O4<a@UL*1N^sohpf30r0=NELqT1bP|s6xdekar^{62N{S9
zv1oaM9ZO<bB(@1=rBrdLG7<Im*7Ta|Da_Yrpfm~Cp#rw=l!*t%6P9<vwo9Rn@{K5E
zS&fY5bnD#za5tc*Jc?mngX3Mi@An6{!E7=q#`uP``UIC8+cC>kiy9aqjQ-)OjVZRU
zNxtWxO1|cxOd1A7T^BpVA;=_sRMzoFjBMP~+fEIY>L#f-Nxg%fzg%dLZ#l3?F9(!-
zYSi5tHq44at5xKn8b%DWy4xgK4pIHLXcaM?H)^QUF_D?sI)t2%CbCEyQDkWQ7DjD^
ux|Uh7U0ptMaj91_v5gUSamCfud8T2OOE$8z#ii(T)@X(+6b%ko*ZLnm!A4~O
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-004.js
@@ -0,0 +1,49 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-004.js
+ Corresponds To: 11.2.1-4-n.js
+ ECMA Section: 11.2.1 Property Accessors
+ Description:
+
+ Author: christine@netscape.com
+ Date: 09 september 1998
+*/
+var SECTION = "expression-004";
+var VERSION = "JS1_4";
+var TITLE = "Property Accessors";
+writeHeaderToLog( SECTION + " "+TITLE );
+startTest();
+
+var OBJECT = new Property( "null", null, "null", 0 );
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = OBJECT.value.toString();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "Get the toString value of an object whose value is null "+
+ "(threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function Property( object, value, string, number ) {
+ this.object = object;
+ this.string = String(value);
+ this.number = Number(value);
+ this.value = value;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..25917db9e9fb801558c5dbdc99117d2455bfd17e
GIT binary patch
literal 744
zc${5PQH$C@5MG85LRf-`h=^Pl5%JpVVZnPUeNdZTJv1#zxECqMUNY6Cdx>n;s=uj!
zvKvFq(U;lpo1OW-ncdkUc!<dQKAf&r)9{B#G1EeyKB6@kEzabpK;<8I3X4MI+3iwj
zR9r?{iELBnhc%2e*Z5*u`!kWHrmEH%K5`}av&7GsNUpdx<%9ooxnib~t5Yr6n{z2^
zI+>bdla(GZR~yu|!>GQh>)oedFJ(8t!>im(=E<*qtWI;TlkH{bn-Ym+g)h&q_imr7
z=92FVWX1!P#?(w6CHW3%lqj*&>nIKv!F^P};vX2>zqz7DWG^+v;|>$u#AAZHa&>s;
zMgBZqd<)!o5ifl}@6it<!zWe8Czj!Xt+?KfuGvU$m0>-+4E26IzN25bkeD`NEcBcg
z2-ogI^x<jZXp;cO4$6GkSL7+GIA7))7H{#aYUVyaHvP`cI;m5-41=6qrenr0KV%J^
zSD)Q1G*`OxS;wL8*IW9~XFxpa(uQpT5CY^4v>ighwOwdcpaH!KP#9PqxdmckzYWx(
z4sn4IT3y4xP78(=u;FdD(`td$Y(SfgfLz&Lr!}xjPReL|J>uOM+$NpA5i2F3No?p6
Ki-57Y0`eC=uG&8U
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-005.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-005.js
+ Corresponds To: 11.2.2-10-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+
+var SECTION = "expression-005";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var expect = "Passed";
+var exception = "No exception thrown";
+
+try {
+ result = new Math();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "result= new Math() (threw " + exception + ")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..982298ea232994cf078e9d3f2eaedd465b436fc4
GIT binary patch
literal 825
zc${5P@oU;Z6h4k1Asiuu;-pA9M8tMZT-&vSvLC9;Iz{7_r2R!kIg>Y=E=}ZePRsuJ
zJrmlD5xBhfzVCbQdw0XJJMqcl#=D-)uDu^|1gVPE^A%|A?zl*P#vq;DT0)-3S=yh*
z3ZzJUCF68e)my_jjj&Q_+IK?6Vwu2a2ooWN%4FyN5(+z24_^rdPpIeEOvvX7X^upa
zRO$IO{#NOp8VI=pRZTr~VOtTq6|pKB!z2rT8TalcNqYO4aX5pg<-c2U)PYnGp<zGF
z*3b&%^GK-h;nickNJoj-<iPw;#%s0k18?l!_|+}G(LUCG3rXKHY`jU7={uufJa=u_
zg|ObQ&tSKPP_g-Nf{+o6gQ;WQIi8O!3ij~!#=V^l9glqxaRLz!9)PE?<>;xnQofb=
zAYVa5AcJh0t&EBP{{GwwAXg)iLknJ)dN&wc^dEC}c6xbv@qr#wZt<>qkl2lV6S#0>
zsjPfgU7@_=X8hGBM`E^3*?jqkcI{jVsrEC1(m4NAxGK>rUT*tREEwJ6Mc_G3bvJ)#
zt4WD%9k7~d>4ruLq2xPl=!DUlR-?QOEZQss^94GfEyE<|l;C+-rwl(*qa9+Futw`;
zpwmGa81&?*-sovMu`y#dIYsS(rP+uQuG#fQTifTvz*9F5iQPkjO^!}<Qe(vcdO^EH
Nr)^>o4afE=`3ob}>N5ZU
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-006.js
@@ -0,0 +1,46 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-006.js
+ Corresponds to: 11.2.2-1-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+
+ http://scopus/bugsplat/show_bug.cgi?id=327765
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-006.js";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+var BUGNUMBER="327765";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var OBJECT = new Object();
+ result = new OBJECT();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "OBJECT = new Object; result = new OBJECT()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..45efc98673cb4174eb223a55b063e59182c138da
GIT binary patch
literal 841
zc${5QZEM<46uuln2;m|@L_|a`B4WF)xKh}MvJbwbokg=@(lU@yZj)2JG$wMrR{drB
zW&6GxQ_Qw}I61G+bIy|t#@@Y8=6AFHblRW&6cHv$sKd=KquU)HgBO9)-LEBXHX=<f
zCqkj*v9F{^7Dc{OxW3{FS9-KH5J{xF3Y_*Mmx4dXIKnXIlB-m9{!eKHrU$t^6p-D%
zel3y=v`99FJdTU-y66eGT%amw?I&*=$Mzsj!`HfpyJCp?p%iP?eE65I_kN|fU7-|V
zQK$~N3YWu}Z#UQq<lz{e4rY1<lnNt#lOLvQyvRx-oZ{;FZxQEyFdKV!ej)d7xHjLo
zq`F}nEBH{xeTeH!i<0jSgYh?y;(m>xvV(CjaRJK@-pIWjd+w<8=+1oIU@6=vC(vfd
zH`u@v+s9t-^N&+I`@-H*5wYG4%gJ;i!5up_bkFE57coX~=CH0>N?j~(6qhQ)w(tE<
zPuDD1;&Dpfn14ktWv7*y9!hr!{m!)<k)zW5X931`QtSE^d4w`ZC+Wh<R+$Gg*Da)Y
zg?bxEiCVO5+5m(AaiMAx3YKX>EqBV$&K(LJ!yzpo+V-kI4QdbzE(y)c0FB%+p_@B4
zoVTi#E5j(2oyJv@ygxdG8gYOyvsA6Lvoa7{Thr-~(uKyak?Ofctc-ygPzOd#XcC)%
IX08DF19pA(KmY&$
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-007.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-007.js
+ Corresponds To: 11.2.2-2-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-007";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ UNDEFINED = void 0;
+ result = new UNDEFINED();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "UNDEFINED = void 0; result = new UNDEFINED()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..fc6144613c5c4522a51dfda46eb52337fb555a59
GIT binary patch
literal 794
zc${5P?TXq!6df)hgb+dy5fNDi5pnHyv1Or!rBJo$)<x4|()}YvW|O-bnoVRfR(*^<
zR^O^OrkJIFX3jlx&i$J4)VufD@@_Gj&qs?NafGRg)$#VX*6UAC!BdRVJ!~cBd7P!!
zvsj@NiLYdwt}DJXj?;*k%F}xgG8T^se!?&jQYcdODub_t!e<h9|JP-bQ!*ismAE|-
zNm7M3Bf8dU;SPjcqpGU*tEWnDj*~3>+46Azf?IjJBxy{93OAEP>~ggHP{v!;3FPs_
zo;$oMP#n(j`SIl{2LD!3<f&Lr4WLvQ(O7<%ZE@)bi>Y_#SG)ZKZ}ne7TIARz3SQOl
z5aPDjkA;UVhRXKcNihBD8Q%BV%nYW%%muU`+=Wjh-%G0d1x181$Y$Bv2{2a^ks}W_
z$Wz>Ns(RXE&&&8ZH&+{(?bBMWgj9va;eDb=4wsI~$`5Vhd63t`;d?`o&iW>3qzL%O
zq8<K$r!?>_FS{>7N>RM@FU@=Z&FaSbEaC*CWw3DFYUmZTyTBaVGVPjf05AsZ9W-@j
zfvK6$EkO;gOJGCOuvr@zo%IG-nx!!l2F%v!GBvAH$^eEX(4kcV1Ns;BW*v;00}WzW
oOLOYYu2#g%pi{Rwb2@|@tT8Z{S){f!xPl9&17`*UD%k_}7u}ENrT_o{
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-008.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-008
+ Corresponds To: 11.2.2-3-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-008";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var NULL = null;
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new NULL();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "NULL = null; result = new NULL()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..9f5bc555603f736ae7e128979225b0aad60090d7
GIT binary patch
literal 778
zc${5PVT;;85M724LI@#<h=?4Ei056ehb?|Nj($)ty?SU`Ot>#nj=f~6OZO7ltW|$!
z|4>&$-BJRZH*fa6nb{dnqo<fG9~Yzfe6;w^Gt3oNhkLZT{pl(A!BK|$jl{C#MSeTu
z3MCV<l007-zBA@|rWvE@J~PSLtH1|L1(Qq_viCowg+1dDE2i*G>!~(l@?bLU2@}GE
z{gM8y^5a!Q4h@+wxk6=HX+^j*7u}a=D}*~1Mf$Uo$isxGbbYRUb3{Cy<J;@Mb9-?r
z`9@J)1f{}EPZFoa1{){!M6hj%%Q#s~qsQ31;%^w*znFw~p0?QvRl|LXo8#Di98Qwy
z*T}>D22<r#Qa70<v(SGI7qQL(!c{LS=vhS7S{A#!jpw%B4+eKYNswTvCags7Gvfj?
z?;F#7W{%Qypo(f)4^<8NiC$jb)2bmI<hY|%rhi3uQm^+5vJ7QX%!-x!6n}Ub)=I^s
zI@SniU-zIDG+E<Gs^8$W+hwu{Lo+#p3koFg9nTMJ*8)O-+(FYJ9@v)i7X)xq0UtiP
zKDh;=&+7(w`Xdgsh+m~WXji}jS^*mx6>y=`YBuWN1~sd$8Pc(8%|_Qc#>Ca9?YBv-
br=9EM;@TmOcXEe542TVN;u1^O>;m}%0khvo
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-009.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-009
+ Corresponds to: ecma/Expressions/11.2.2-4-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-009";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var STRING = "";
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new STRING();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "STRING = ''; result = new STRING()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..f2d40432a6b8e5be29a3f54878665af40472f902
GIT binary patch
literal 806
zc${5QZHwAK5MG85LI@#<h=?4Eh<I0fc;&twS5TW;4^2yw-j|~sdvU6vF_Cqx`b+ww
z`lmXYt6RDYn|XQWnR$i`C&5F+p2p!|HXDTB(mCcTRfoG@MyESDIp0&1{(dcSvq_8m
zdYUSfB8!wv^M#JLhG{;hh^}cr3Ym(R3_oC!2`N+|I~pG;p>Rdm&i^n<av~G*pwZ2d
z$TIET4(PMUkL9tD3skymSEn?-5#UaH_Ao1wANF&w%`#4KlnUoGMU)h4?7!*@wkwor
zqN{qxiPL0;tCxTG(Te3^Bvi6I3v!}FrfXF@MMs&~Zty9J!$~lX^m>28JM*WI@WvsY
zZKf)?PjG$I?neG7o_r1*+^;cFPVjX$^g}zI#8V&8ee}bKvXzYzQpLDYJYFKtamQ)+
za>+r#&um;RWwFcoPLixoDCQ{RVp=RLMWydc?)!d^ms9Zj6H^)PUc#mGMbLic&PS1E
zIJY07o9A2L9`6z@0h@T<!`uE%-%~~TTX@I8MuLRLq3>(e1+*H#JlC<@ifJ3b7_c$a
zZRUV!SkNnt3Uo@tg_`BEDlmE*HE`%M3%bm;S%cC}lf9l2Za}*<%)gX2w0Nyv1*_s2
rRf@2-;nnJG<LEP+Uemo`-ZimSS^vsnmUC(X7jVT);KXZC>n5;2OH=6Q
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-010.js
@@ -0,0 +1,43 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-010.js
+ Corresponds To: 11.2.2-5-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-010";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var NUMBER = 0;
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new NUMBER();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "NUMBER=0, result = new NUMBER()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..35887e6cf5a25879cf3c691a64803bdfe26a5fcb
GIT binary patch
literal 818
zc${5PVT;;85Zw+Tgb+dqA|i4uBH~@IhZesbr5KxD6^+G&`y%DoOQsqwm&j(V`b+v7
z`!Bj0xh*BI%$u3_=FP;L1k;eL9+so|e6;+LCYXy<9PfW?-QMI3ex}I%!<J)NrbT`?
zO9gV4g@UK~TIJhbnkO=&INe9aQ}&$U7mPE;nUGzb|8oWJDveMufv=KJr5NK!RcVb`
zmMPc_aIcX06zsBWIFewUpXd?eYZS_f>19Ry(o+qJ+rO;i6-9<DSB3hRiFh;4*sjEO
z#E)mF3`#BJ0u#AU7#CZ#!kDL9aeL}W<2k-Q|9iAm7%eBkL#WRC2Zs7D#^JpsTXvbS
z@UX>LxOj+hd%Bbz`r~M_2+U{_&3xNiEN1>Fuom7_<^k<Te;LYhHz?>Ehl&j^_PJXM
z#zlmspwR|tj(aK{o{vrUT<-e~S%N$&X2p7T5vHH0;5)phl^qFBv`evfZGC5Q;l!MV
zgQp=}JEExmKTzj1XUs}$;oG_&`h$TXWZt1YX-NuMUs;-AvWk|zua1yHn*wni+cB-0
zp=&@0kk8Q2i3Nsc!fh4Qpj`zPG)<c{fXKI12TOj$gdVY~vfX@F1sZ&;0t4z*paZ?C
zyG_uEE0N<68%RrY>uyIg8#RsS@-^%Zal2B{AvZS$F|G3exPm@0phI+`$+34p{sMTw
B?RNkG
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-011.js
@@ -0,0 +1,43 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-011.js
+ Corresponds To: ecma/Expressions/11.2.2-6-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-011";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var BOOLEAN = true;
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var OBJECT = new BOOLEAN();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "BOOLEAN = true; result = new BOOLEAN()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..d0a5fecc0774944d14e2625c12d2a46c3a7bd61c
GIT binary patch
literal 833
zc${5Q-)q}25Eh3q#t36fFrkDZvJjH4D{a@cV`UFX=4B~~H)6LhWpt`@OT=6|DC&|t
z?O&f9(|GJfy8G_??w8abg*OqoA5MFdNpJdH%rH|zZLiU2bw)eqr$8BOmJ(Mhk!L4k
zp-}QPQc`5|3UBsBHq%I@Y29%t_+yHnFiE-ODwpm5AuViIIU>asK50GE$++BBk;Z_h
zY2|i$`kH42wE_=9Tvy&jMTxnbqpBLSAHwG}wfkwF{9>AhQsGQ@7A5%-{Q+0WVvzFZ
z6*gnJ-MRb5Xp~5?RL2D%k_kRN{=1v|D4veOVN`ALmGQy+%_Y@@=TyOK4>t)ei?Jzg
zmY66f3I_4$Ye-9}9gpI1;Pr2Z;q9a!Or5)68tE|LkCMPXvJBU(+<vFI5Y6s2E3?0Z
zcDzp4zKPBrE*iM+?#=1hIW2`OUf_<b2i`plbiI}0QpLDZ^c&YZnYpZ^7E*KQ+w-fd
z%Xe-O8}Jp<&s?N9V{55@!WZN-lyN@J=a$k0V<B9XmsQ$f&i3;%oh)Bx!0zK|5L6rb
z1MC2Z=ejm^JktUo1jsEMScHOU*e`|$_0n+Quryrg*bZp|(dUT|)Sw2j;XQFI;_EQ=
zNW%m;FUbJMrD4KlX;{!Ytot>v-5PirAq}He_ghBc6HA|_(<HSEo!%oyM;5V*0@MH>
O+QbA#ECRalDUiR=Hta|M
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-012.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-012.js
+ Corresponds To: ecma/Expressions/11.2.2-6-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ http://scopus/bugsplat/show_bug.cgi?id=327765
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-012";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+var BUGNUMBER= "327765";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var STRING = new String("hi");
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new STRING();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "STRING = new String(\"hi\"); result = new STRING()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..52cb371c54c9db613513c9e70550de4d7f4c9afe
GIT binary patch
literal 859
zc${5PVT;;85M72KAuJ&Tu_AITBBIypp?BV0;V4CIYCSY9CU+ltlw&VWH8du&u2p|T
zKlg9;Cv;<4Q<@Kx**EX)%)IT7+&hmv4yV1zq&NK%&M=mt+~5Ax8qLw+@HIr?>{bHT
z>oAGW$Du^QBTtGjp67V2AI39<<eK^e7a@O+@Eryb7hEQy@js-5jr<Nza*0c&XX-L8
z_Iaf`;8BzxyFK-r$0^n4VvaKJT5)lk6Pr0P2aP9p6GcWpN`i0gKkK-gC5kY}Nu>do
z!D0~c%^I1y1%<?!8s7_&6`rM&hQS1v&;NQ;^TqxkJ1#=KK!hv#==sx;JM?mUUudrj
z-?^Ylxrrpav~d^UD)ocnZiRs~J!jyLKDyMspY)xn;g9^W18Dc}hZ$l%I8!erTwdJV
zTwhr-$)1F&Rn$~fJdX9M-MIwzIg_zBEXFO%NX<^`mSrRS#Sf%ri*1E6<^%E>3O^Yq
zbNZf#5zgo*uDqBre}M<SGUM>F_F8fweOyajs$iwrfUgl+7Hi6dP*mg2>pXQEZo-bc
zGF3^o@uNR=oZOoqP(J};TQ)V!VnGKW1V{iColq!f22``82;D3(p_wH%lnj%c0#UJ6
z0;*As7;r*NozzvC+N4s13ORhg-ewwrdX^O6I!knD)XJqI7)1+gg^;Rdl}mLkJriBU
fg2{+gR$XjzeyS5A?L#$Sa6t;tCOQGt{|v})80+=B
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-013.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-013.js
+ Corresponds To: ecma/Expressions/11.2.2-8-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-013";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+var BUGNUMBER= "327765";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var NUMBER = new Number(1);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new NUMBER();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "NUMBER = new Number(1); result = new NUMBER()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..8084635a3ce8ab1693d139956da642c54dd7e5a3
GIT binary patch
literal 833
zc${5Q-)q`X7`=Ri5JCtch=`PO5pl8Wr0rZgD0?t2a}JH0N&6yOxsBg6TbjuAI+gwN
zyD^;^d%5|3oOABUN!+3TDIl}Kv^O62reEVZrXm*mTU46P@X&mZk$bxp$MrhS(#|Lr
z$XOBy9;b_P-f-h|E+-|YdCz#v9us_zQNlPA8E^eRlEhZ25eO#mN%E-_V|-t3PWmiK
z%C_#~w(Pn+`B<bmF=Tv!qV(XDs}iq2_?slr-6V^CQVBpVa4ww%QMSTrpNVMMPuOOS
zMiB9MCC+nSaWuxK$A6P(gnWMhA8pTqa60q{L7CzU<*oXQaYIrziGY^|?p7EHGw}N1
zaN^szi*S{vV7imZ$m{ufI1ERgdGAeweDB^3{JXL1O#x}RM4IB3N|T2$jn`K<H`j0I
zmdh{l5!oDhn2oZ9y%vm%5ZB_{vnYLcAi7zWAWNP0EiL@~ofjyl4b<@Z<KDxim9zUy
zCh(cbeC8H)#F9&>`K$qLO-M+~&*<?LsDxzO)Dl_oZ#3{2)vJrkZs*6^_`u=>=d*C?
zd1Xew;j|9KwhUV{EnNj51jrYtYs3Im(V$xt7Bq^&glbXPP}5Cv0z{tmDj15P5Dh3X
zHDb%PVUaT+1r*@AD0H|e3Kd$7TD1at#Rf}G$ca*^RhvrQ6IGtNNlE2Oid&?4rV%Zd
SHxxJphv;xlR08ta4v;@PnCyK3
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-014.js
@@ -0,0 +1,46 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-014.js
+ Corresponds To: ecma/Expressions/11.2.2-9-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-014.js";
+var VERSION = "ECMA_1";
+var TITLE = "The new operator";
+var BUGNUMBER= "327765";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var BOOLEAN = new Boolean();
+
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new BOOLEAN();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "BOOLEAN = new Boolean(); result = new BOOLEAN()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..f723dae7dc3045f8d852498f5260a03364aeec6b
GIT binary patch
literal 785
zc${65VQbqk5QeqG7-NJnp_mdv5g~*$>$0}XK9zk)GPg@f+!1^I5=K$&Yij1&K~|dN
zH|&S)Z%wvYT!um1y{Grl>E!X$yY<QPW-*%2M~k0vgsF_>{_3~Z?M=(%DMsP$)&lc9
z&eFjwmMD1QOA)85T5pfzG*U|K>DEPGa)~dh(7ER#=8p+}#W3N5%S?3tm(+fyU|j5L
zKx@L2q)yFol7+u|BbBVuf?Jn{wHR=*LRmNDOt=i6Ckfx=Xg+wGB<ZNlC?rND&kwUT
zvVW3ls}$OS*q6q`C8!^YcrBYAZtHW;igFyz@#XRDxR!pfn0hyUJ=i}m)L*%P_Y`+)
z3}pj%A+C#CQ{~wt((>I&Fun84U>eL^K<nOJ_$qH*Z_==wPBDy}Uh_D?h<@j);i!d&
zBR`y9d<NF9VC)O~G<fC72JfDFr&o<!av=lErOkTsS>Tp+y^I}NU`orjse#I3-uf30
zL$(#_!M`DoPz2d5TRCrdw#=&k08R~AKnwDO=eP_Ou3O*v2e1|pi<;EdH3P^yARoao
z2?awl;kXKH=vD!RhHjA)AZqP7K-EV~XcAhL4LGU-9oki(fpcOvfhceTl&PZwv>eT{
mk2{*)I5J4F>Q;wXXA0UTmwkhnv;;#R7|~%sG-4>{Igr17yyfHo
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-015.js
@@ -0,0 +1,40 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-015.js
+ Corresponds To: ecma/Expressions/11.2.3-2-n.js
+ ECMA Section: 11.2.3. Function Calls
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-015";
+var VERSION = "JS1_4";
+var TITLE = "Function Calls";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("result = 3.valueOf();");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "3.valueOf()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..878cca7ceac9b1ef412dde179ced9a130e46074a
GIT binary patch
literal 807
zc${5P?~B?%5M724LI^=bf`~{Ek!Y{t73r7K4{CE)56u;m-WMsyUNYw`jfreF{`kvE
z|GREfOxs=9%*=cH_RVB6^B#P%x?heLi}CUYi!c#P96$Y19A|b)UKw)tu;rL#EKLS;
zCXmzE7n~*QvfiGsB$Ac#PPYVoK?QCk(0QVq(U%y%U>H+QMasMXmn7eoVw4|Cf##IP
zahZ<B^0Q6~#eniPit<&bgi8KRVSt4T+`RnVi$00d@TdOl<#F5&_;E@__;&SboziJc
z^9&6?<ZLT!DUMuVBt83Ky2XZv`%-UsnT?lkkh8D^THpU|XXOXWnRoA(<NggJbw@e8
zGbAOCg@K1HhN6mx5VyrhOy8Xbvqw)4X2IMAG@sn1FY`)(nV8ZHn|FB<o`zS<DyxX}
z{EIXp3ED1Yk@1a6`%%Sq#2d%Gtv~p;&m()!rR%RqBjiCkPuCr%Alt*<U`OK|A77nb
z*GuiI6I<R+_X+gO3l4TQ6O@a>iE&3+j8PM>y}lpbeq04h*Dae3p=ARx4c(|{sse-n
z`3#m$4A2xEKAeLJ*yq52nre~(5P7yOFytmW+z{goD=<6<8g$Qr3eAR9?}J*cC}yqO
u=#b0m18FLzRqrSTL{xcdW{sGZ)NYe%Un9D4(uWSThz1T(i6URE1Nj3Ev+dCU
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-016.js
@@ -0,0 +1,40 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-016.js
+ Corresponds To: ecma/Expressions/11.2.3-3-n.js
+ ECMA Section: 11.2.3. Function Calls
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-016";
+var VERSION = "JS1_4";
+var TITLE = "Function Calls";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = (void 0).valueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "(void 0).valueOf()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..7b9e1af4847ff7a57885b57f7c6692173a8d493b
GIT binary patch
literal 750
zc${5PVQbqk5EX|p#t36VFeR8`Ldept3+*WE!#*XM+odG#h)utQQB?byimG;yl_vRB
z`-_v~5tm_*@9ycnyQdpZqq~?aZx^Hae6;w@Gt3oN`|oJ<2Gc|G%u$BBwZyXIMLwKy
zg_4O_NuIBodUwq8OjjCCzX4;#6uxPo|G*??PXd2nDwt$SgT4Q2g$%S9llw-%pD-bs
z^m?R!tGrT7m|UT1x(*tsxo<y48zJnmDAL!9Y8al*@$KoOuR!xqD$MjWaaydA#;N3M
z<xQAMUnYWWO6)|q{opu}`vZ7%w~Uj;G`fwOSNsEC&37i@Gu5PxP%Yf0xUO7N+^sQH
zP8?2>>3w7;(_|Jp58)!#86dr3Twvw~1N9<t8$dvRF+E|{kBZ<Z5@@j4=B-jOsS+%e
zpKG7PcP2J?|2#Oe@8YY+Yafp@f4RK+7Hp+n;ZI~4%A}YTD_0fuHoc1dk8CL|=T@2%
zRwA7FH=8^?^sH7<E|WzVHa_RzcYrw5rjBVDKnRde;8}!%ZP?JQ0|$aSpm1qA#0R3!
zo(EKa#0HPh8aAL+2PSmtz=D&m*KUK^at((JfSekx*X|irPAq+z&Ixh*S}-6N=N7T)
SK@?7*O-vXPix|4qIgr0Z>f5FO
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-017.js
@@ -0,0 +1,40 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-07.js
+ Corresponds To: ecma/Expressions/11.2.3-4-n.js
+ ECMA Section: 11.2.3. Function Calls
+ Description:
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-017";
+var VERSION = "JS1_4";
+var TITLE = "Function Calls";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = nullvalueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "null.valueOf()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..3f06fcc76f450e932b58921205c47c439f065aeb
GIT binary patch
literal 838
zc${5P-)q}25Eh3q#t36fFr|bdLI_FMmbUAUZDkKh=4B~~H)6LhWfax9CE8p&D9VyN
z?O&f9(|YVhy8G_#yHB5b!|*mD4}(c}Jnl}uiz#MGsO=3J&GvAY{17OE%|haGDe~-O
zBos=XMoNloR^g4F$fg>pW?J`L3jUPhCrnZ<xzb(D|FK-QDvn5Th0l7PX)-RiRi)nN
zX<DWGA+D>e-PPADD+Vj@q5@+sXQ(P+_G7q8Q@fYu$uFkcP%4~iVNsGVuo25`pQ~j4
zD(0w&L^8(br+<y`cU}FIua-!oM2dxah~mjG97L6i$HoWqH<wh;tWpJUC~g**C=WLY
zE($}ODCoz-ub~|e<556M0zj{KHwf>>y<p<p2a`xQ7<0kmIkF7bOv~I^=d!k%OAP?4
z<Eyaa)3f)q{2uz5ixj8y?fLcf)upTQ5@u_uKk*ClDatq><ugm+Qh7_orHXab3Ul_V
zkm(iqI{T@g!Ag1T<4#4%)o#p1qjST`7rvBseeKSTeH)!UUbqEmpKG7Kac%b$IuG$A
z2r8TYKw}?>=X$n7YnBN>2#`D2GYJLDu;HK#YH(f#^rhrM({{)a5Pi0NpawOF4Ru1x
zGC-pYEI26x6Rzre{;6RSUuTX>nBL~wUJYF00AYr^=QoWaC#F6v=YY5^P4AM6LyOqO
T0&2i1>=OtD#kd<f((->U8-
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/expression-019.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: expression-019.js
+ Corresponds To: 11.2.2-7-n.js
+ ECMA Section: 11.2.2. The new operator
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "expression-019";
+var VERSION = "JS1_4";
+var TITLE = "The new operator";
+var BUGNUMBER= "327765";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var STRING = new String("hi");
+ result = new STRING();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var STRING = new String(\"hi\"); result = new STRING();" +
+ " (threw " + exception + ")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..100e44a5f3c35395c451fb6fbcfb4559aa25d2ff
GIT binary patch
literal 872
zc$|HbQES^U5XZH{7-NhHri2ngCqfAB)|Dg_R@hUMnJ%UAAa={3jG{UhN1I{?S!o)^
z9{04@ec;InsmmVrBHi8p?suoN2cz&RB6pXQi}Cnk@|909Q(SF6{5CrNXzR>4%HU}!
zu_$<+onCW=l8H!3o~2d1Q<;%s3KzPxHQ?D)XH}f`Et8x*2>ghNV3Mg^cK!`%LUYK3
zsDM;+nA}tW|3Y7BR`#fZXH_s}GDTIjwFe?kzPDnz88Vg3p9gG&xPH+_15hfQ>WQKx
zUt)cmJrrzJV0$laQCr!G63Lg!z7JPIoRm<WjB)Ysa$R>(JQ;<TQMK4#M&Ep7(!-|&
zm*ry}ow^drje=o3`W)KvD83Hhtv9&23~$DRU;^mg29ro@){+&4HDg@-nXR&<tS)Gl
zD_Y>PTpdp7!$vy`p5&s`m_&+F=CYtXqmL-J@9g!vlx0&o=jj|}Eyh9(S%K$!CY|}m
zKYl)YY3TvAl+LTEeD~$)TIwI+6S67FIKR$Q`zpHc^}RwdsY+re%jxqQshZ1tomu$E
z#L*u7uG{UMek<%=xBve9ODXxS|BcW(roQIjn%>2eAgERv0Brzq9mlk4U;udq<Tcc7
z;(%qEaI!OM(B2u=UUJ~na7YJ;K3jEgZPz9yG>Ns74e)jbfL}j20;0hl=-f9t(rB9Q
jL91;THP3(peS*^_F4e3<a@eql>DtgG03I=Pg)aUJfISFo
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/function-001.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: boolean-001.js
+ * Description:
+ *
+ * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=99232
+ *
+ * eval("function f(){}function g(){}") at top level is an error for JS1.2
+ * and above (missing ; between named function expressions), but declares f
+ * and g as functions below 1.2.
+ *
+ * Fails to produce error regardless of version:
+ * js> version(100)
+ * 120
+ * js> eval("function f(){}function g(){}")
+ * js> version(120);
+ * 100
+ * js> eval("function f(){}function g(){}")
+ * js>
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "function-001.js";
+var VERSION = "JS_12";
+var TITLE = "functions not separated by semicolons are errors in version 120 and higher";
+var BUGNUMBER="10278";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "pass";
+var exception = "no exception thrown";
+
+try {
+ eval("function f(){}function g(){}");
+} catch ( e ) {
+ result = "fail";
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "eval(\"function f(){}function g(){}\") (threw "+exception,
+ "pass",
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..f62626a76ebf834aafe9076037883ed3e739b9d7
GIT binary patch
literal 757
zc${64-;3Hn5XYAxgb<bxM1qJMi`d{@uZIVHD}7L#T3gK(6YfRIu_jYZyO+pjt@_-*
zr2lC*1}>#9yEEU}`OJ@<%)`$SS<hDE<#N3GmZg}hOr78THvHlI;(X6g2B*EmvdoJ7
zZjmXJTtrG{`L@yflPpiQ(&YF}Fj8FMvkv%=TxNVD@B=1-ORjWq@V{0_reR#38$fT$
zg=pO2SYO+`A~xdNMvS@KqH0>PC!$Dxc0)Wi&+Vu1AVfcw=P6go?xn?Eyvxew8Pimh
z3RB%>loWfUQ6jUwx~&qjWQot4f7jz(U{k>lC9b1*H4kS|v(!H@GJkPN_2Yw3@Y;!j
zX*_=jDW3M2s1}|Q+*doX<9WOYoX21l=`bJ-rpxiuy~~DbC-KNyrQ%Y>SSq;g$2(**
zQEa$i51SvF<Eo<m9zQJD3zO;8;+Xq&arU0&8l?2F!)r@v68*~csA+q9LA@D`?t!tR
z)ZhIHd5SVF7RA=BYEF5H^drv%rt5eW1kHe7fL#G`s7W2$0w4s)EAT8r!8T0rYr}z7
zZBXc%4)K8K^Tq>eP=lB-B(x3#+|`B+SG8fmpxf@Wz;s*S^?(cvx7`^Sl}jvr+D@Oi
bS~op%dt(u^B2ohww22KJViC}l`au2y-2UB<
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/global-001.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: global-001
+ Corresponds To: ecma/GlobalObject/15.1-1-n.js
+ ECMA Section: The global object
+ Description:
+
+ The global object does not have a [[Construct]] property; it is not
+ possible to use the global object as a constructor with the new operator.
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "global-001";
+var VERSION = "ECMA_1";
+var TITLE = "The Global Object";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = new this();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "result = new this()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..3b653e35574814d62ddaee432626ecb1a77ac697
GIT binary patch
literal 752
zc${5PU5na46df)hgb+dy35$pfV#VEVmu=a%(g(Gvb*tH8!oEmZ#^hF~olRsiR(<Y|
z=-=&VV5gLUnR7qRxgRr{#`g(XP8P%Ye7N|=b1W2B$M?Uj{$P4GzH^k(VJoq!cv;-c
zxI)Q9q9iZY#@{zEQB2{prglfX$aR*{={+*Z*-GF?%mkB6m9qc8ODj-KWb$Yv+hZn#
zG4F=@Sr?}oDU)kdrozC4Oujo3W%kp3ig!Y^V%(cZH<iaRQ`zRF>FX2X*&Lr&|IY0t
zndDnVwLD6Nx$Zj2$}NUx_E@l8h3$01D??c(>0%mB60_7laBKf!5?*^cWhYbv4;gMx
z6Z=UtPNxsChled@%1x)~ECTc&qeY_Kfhy~TI|?fWG@t{uk+`RD8Kl}XW)-^k$=j#9
zPOVHoP^Ft0Tza1v7nnEKqFgcY=Jxg--Anz2pONJ#({fg>`*BHM8qqXa?u$mHm{cd}
zZn{A_IkV}*>W6O5`^xkZ@@2Y+A~V|;=ujZO=XinbT0jVpR}i|y1IKotSAzgLHSplt
z^2rqtefLA~^dSy}#H+&=bZcP4paw47w3=Z9tVUq@Js@4%Z-zbVWD-~3w%;axL+f3T
X_LV~%@2m+FE{F{+;u1?&Y6AHSOIh2)
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/global-002.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: global-002
+ Corresponds To: ecma/GlobalObject/15.1-2-n.js
+ ECMA Section: The global object
+ Description:
+
+ The global object does not have a [[Construct]] property; it is not
+ possible to use the global object as a constructor with the new operator.
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "global-002";
+var VERSION = "JS1_4";
+var TITLE = "The Global Object";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = this();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "result = this()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..3205d7d5ad2896a1b586660c5ca90cebec6c1fc3
GIT binary patch
literal 799
zc${5QZHwAK5Z(?Ugph_Hha4iuA|iUd9$xX=(GP0VtKv&B;l4;Y)@15!yC$+(PyG%3
zrTrIO6TBQHu*^L3JkQKdb}*Wa1G0Qr^rzGQ;s=j0QCuDG{}`?IC{KQJl>T8WG0S+G
z+)lVc$wZ(ePu3;g81N+4NU3Q(GRfIW;1`SplT2w=s}ux^Dcops^M76{>q90)Nu}DG
z$zuuF1Cd6*dwrd(laoit<Qi4kyIqz_Rc(g*Hy%&3oe(#tF?ck^&Fbwfn_7=jVVpM#
zqI8S&4C!%mzzHJBx2h4!<B+N7`Sn88JRJ(Q%WxTli_z>MC>Q$|dgcq0@S%c-2)C!L
zxPd<mNAsDZyYGau!%;Z#9XxC?Qh@HGzX)_SoDasDM?cd9_jJDcrK|U}ketDs(e6|Q
z9(csW$8Pt|`O3J!*n4jmh8}IJXQ|1pSxR3=pc+f}iSwQ5TgG(46Qm)^jb6O|9~pEk
zg_*L)!QE5O3w1bT8G0%$o&iw0m-=0NLl&b9(@DCv@P&y=rkGSG`Z8Sjez}A>&?_LW
zW7?kKSU}zZ=|I&a4%mhX7e(Mfs|akMmP0-P(dTUyT>TLfZiro!t+UdAdJ#Bq)$r;-
vwDBca7Zt7RngEwg!}Tt6#BgfFz1EIZ(!REc>E^Cbff_NOK^$UfO%upJ0T$|;
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-001.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-001.js
+ CorrespondsTo: ecma/LexicalConventions/7.2.js
+ ECMA Section: 7.2 Line Terminators
+ Description: - readability
+ - separate tokens
+ - may occur between any two tokens
+ - cannot occur within any token, not even a string
+ - affect the process of automatic semicolon insertion.
+
+ white space characters are:
+ unicode name formal name string representation
+ \u000A line feed <LF> \n
+ \u000D carriage return <CR> \r
+
+ this test uses onerror to capture line numbers. because
+ we use on error, we can only have one test case per file.
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-001";
+var VERSION = "JS1_4";
+var TITLE = "Line Terminators";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = eval("\r\n\expect");
+} catch ( e ) {
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "OBJECT = new Object; result = new OBJECT()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..4aef05403a1e26c8a3f7873951d583052f600769
GIT binary patch
literal 780
zc${5Q(TdtY6rEl|2w@t6EFvOH2qL=Oid}pweNdZjT{K%v*cU0wY`k@c9TS<1tA0a2
zt3TE;!A&WF<jy_!oH=tQ<7s#ok>%}TG@p+aKlut%#ntiiZ==(l7K>jTWpLO^%yXWl
z{TWv%nTV9+>ALFsW1g;br{Z)fFj7q6MgyG(COLZ&_!SeuBvTq}|KH1`r^T2&RsyXF
z6QWvnNBXl)Pl{F39*Zn_8CFot<Qi3F$bJlWLbUY&N`<RpJW8@H(kPL9tNd6VCrl;J
zZ+5Rw6;I~4dHOd4?<}F67Xr-?_Z3_(L?(jma$H97VjA8?Rj_|xXudKDADk$d#MAqb
zYT8by8Xgkdo&uqG*kYpWcpA?F=OI``dJ3?XD<)NpxpKX(dX~8N=r_g%uILY@4XwNx
zPtl7}ZghG&#oWSICfxUSspqP!ytGc3d2gF}S}EJ7{nEsj6Qk>&DSodm@W2x$J`M&q
z;8{xV4n6xW`t&$-PgW)@M{h6nKk*&e3T2$lvh^}v1VMG;duVz<9BNR<vP~fGfb^hl
z5el|pK&LDm=$8eBrs<Fx5dFTX1Jw^Ppi5{8n`fp4ep%SiXw@1(v~UAV_d@epCctIe
jaBKCVV>y?^)fP;j46ZC<&_Wg3a6v4%CN?oO=L*PQ4VvXE
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-002.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-002.js
+ Corresponds To: ecma/LexicalConventions/7.2-3-n.js
+ ECMA Section: 7.2 Line Terminators
+ Description: - readability
+ - separate tokens
+ - may occur between any two tokens
+ - cannot occur within any token, not even a string
+ - affect the process of automatic semicolon insertion.
+
+ white space characters are:
+ unicode name formal name string representation
+ \u000A line feed <LF> \n
+ \u000D carriage return <CR> \r
+
+ this test uses onerror to capture line numbers. because
+ we use on error, we can only have one test case per file.
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-002";
+var VERSION = "JS1_4";
+var TITLE = "Line Terminators";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ result = eval("\r\n\expect");
+} catch ( e ) {
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "result=eval(\"\r\nexpect\")" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..f03284146d2e23864522a4518348eb09d7a4ff67
GIT binary patch
literal 797
zc${65--??+6vn3q5fKpyOISi!h7dw(w=r!)Z+ewjyUmi=67AlEvdrq)tnEa@IN2o6
z(1+}+bQ0;hEz0nnKi^N!(aAKtj>z(AF`m!Ii|<*Axy<C@!!NDZpPqvI3`MZt2rSF2
z$Op4bqF_9dBFk5GzB9@4RAp*UuP#QCNnEQ!?}mwt-EsVg31@;yRqXzsD+E<ACJr^A
z?K95n(46oh`8gV^V3i-aF%v74^|SkRsdhDeCX)xBvu%m35O>dbx8auat}>yJn4aiS
zQf$zQ5|M3WCl-g3`Du{Lqso#wuJ4|2hyF#VnNEOZ6fdUXRa7tbH;nX0Cg7DF1%5pJ
z5?ac;<<i3a1{2x9eS(|gUd(tJ&jR}<SVXD|(E7wOj;Z4p>*E`ghQw0RolxK7GqMy#
zT+E79FD&R2g31R`>~aGi83+2_b4|~sxw2tOlL|v!&s4WV`>Gdr6kfJD?z4pP*Tdnv
z!H?4V%G6Bhz;iwKU#sgWvm=Y@S1_-mH@71vRxLg&u~AAU<S|;tiy)}y{{|ObAhxAh
zwrS`<UI6i+X%GucO@m$~Y#3C+f-~JFZ-J=uya|@Nhz1wLs>(VvDq%va5(f0C(*~lz
w4N#`G4nUil<FvY(e%8>5p-$885a&`s&&kj=h-RI@;6jI(&?N@Zm9q)t52L^5vH$=8
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-003.js
@@ -0,0 +1,43 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-003.js
+ Corresponds To: 7.3-13-n.js
+ ECMA Section: 7.3 Comments
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-003.js";
+var VERSION = "JS1_4";
+var TITLE = "Comments";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("/*\n/* nested comment */\n*/\n");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "/*/*nested comment*/ */" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..e161089dd40c5f8eea70e987b6cf512f8bd72968
GIT binary patch
literal 775
zc${5PVQbqk5Y-N2j1k6!U`7Z*gb=c>>#~t=Wgn8v>(V9Oh`oLZqp0>Z6;tgXD^2nn
z_H*_Jr^IX?MIfEtz4z{Pn#`i>n5?dr<HcgU{2?;Twa|ylUsiuGJ6-Mts&KziSeBy5
zFXlp{;xg7s<m(#mPDGv=q}KH7WURTyN0aE?a3%Pi#E+OtuDC8#|2bs%?J1YCmNVnc
z)u9GPV{@$YqhrF=8g*TDP^W6XJCQ~Dvzw^Hl<V}NZpV;OY0OUfI4w5F{z9g$6X4!P
zTPa%+?rJ|8r%G(}`O!$E3w*r$e?-Bl$W-!eiK{qS&Z4Wh9_()z*-u=-YcCF`$?R)H
zalgS-Q={HW-N1c{o8u7NWR}cB?<QQvh6NZ%+>4aUH^bq`!6z;|#)jplIrf2RwMAbS
z)vxrUg8j2$`au=D92ot?g~ZHf1B2j>(Qn*5HFK}ycef))W2xCrna}-<JVTWf^J48M
z2A%Q}8>Qw-A8+uAJu7?Zf5F49P+7T3mSI@G^gFN?5RY2ab8QF63m|VHa0vy+vY=4~
z9`ve!!h4&Nb0B6P1mKxPENBy2r5)&0feWoFu%R0?Uji}44KSjn4KVCkezV=P?1t|U
g+w3mw65o*Q4mmq>h~=G(Apk~PxF9xhjIs~p4+@Fm?EnA(
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-004.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-004.js
+ Corresponds To: ecma/LexicalExpressions/7.4.1-1-n.js
+ ECMA Section: 7.4.1
+
+ Description:
+
+ Reserved words cannot be used as identifiers.
+
+ ReservedWord ::
+ Keyword
+ FutureReservedWord
+ NullLiteral
+ BooleanLiteral
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-004";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var null = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var null = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..7a643db08b9233fcef4f3c82611a4c0434a8b4d9
GIT binary patch
literal 769
zc${5PUu)Yi5Z4Z4j1k6!VnPT-gb=c>>$;LXl|3Yx*QHCm5qo_Jqp0>Z6;tgXD^2nl
z_CfYFr^Ku-Lm=+%_vcQh(ImQ#$>M50oXv*wpCZFt3%$GiZT0$-Lvk-rh1-?FvJ^#r
zHWeBbm$6nNU)J@`NaUHR)S6xm#+qw<G(hi$E5Yw1e!^68#kB#u|JMrD9&;&cIWyi|
z?dpO%l12KfKQzfQ-}~0kpe`m{Em7A4bq$0{V|Gx-X|cjqgqvDR<5Y>2X8(9*umh`;
zsNI<B^x^p(?rpS|@^qhzbcT<2FIN;CxMRuJB`)G*K8dd4da-|CU_WsMZ@f4hCzEdx
z#qA1HO^tdjbpy94uJ(IzlSwiSy_;|z8x|n_%!R~^ZIt<eFUT`gNii*!@H&vV6)Bf*
z&(A;5@7zqE`3aVK%uDoHUq2|^u%=dPWFOf*mn8!0MFo3q#SEp`<PJV@*?P&l^mS4F
zw4;ro{}p$eLS<#6)LiL(5BEBLe>+$t^DwO6_ybyPARe`-=h_aCS3urD;1CL~WkItF
zJh-R=3THMY=RnMT6o6+Av7kd}1v}8F0vEbfU_<NJ4}cis1{hJ#2IzM!-)CLRZX7wp
gHn&SV#6K~nP0~Jbh~*uOfx$6xAs{w!jPex7Uo?;4qyPW_
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-005.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-005.js
+ Corresponds To: 7.4.1-2.js
+ ECMA Section: 7.4.1
+
+ Description:
+
+ Reserved words cannot be used as identifiers.
+
+ ReservedWord ::
+ Keyword
+ FutureReservedWord
+ NullLiteral
+ BooleanLiteral
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-005";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("true = false;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "true = false" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..aef177071f65fba6cc124fda051677d13d502dec
GIT binary patch
literal 785
zc${rfVQbqk5Y-N2j1k6|VoC``gb>`U>#`B{rR+nJd0o219kJIhVHCx_rCwD#$V!v^
zhW)Vpttkns#~23r-Q9cdbf>{6x{k^0YTBPn`qOWDhK0)2_VTCE4o3UndyX>PEG1S|
zUKSVQT%qJ5Rx&RZb-rE0SaF4qTG|}sMW$J`Py3e3oX-V*z*KO_m8Q4;&6SdAA(z|Q
zvN7aB)M2l$e~V(*BjIv^s_tM9M43JWHKA6W?=F_76MUTiJyA<@Q7X*#$~Y~TNaIxI
zOJ(0hD<MuIT-R)W$W?kj6ns@7`=ito>~+mVZuj-)70lvfI*P91da=KtXFhQWFR6B1
z3FXA$Fd5xM9&S=x?iNCEv&2-{$tW3z&TTl2bs5n8jN5f7v&z1X-`w>qeBuI_%K~*T
zam|9cME=0uvqA?q^B>wFIAd$6pX(Fy3}sS|%LV<&bAg#xDK1rlmGT8{@|25L-R?X3
zh3kPbcb6aX3SCtmp1B>B?D=|3_bb;0oLNfqI{#~XIZLKtSkL?wPMSa*YEs9t4InRo
zyawMQ6l~Lk)&V$hbO01Q!y#Ir&r=_${)h?3gdWNUumiB*`~Yldx4dH@+Smgv@=buZ
q%yhj*%P@{ygV_4C9G|!yZF)+AjzvtmH--kB5DPAdO$@E<0{IOCx8;2R
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-006.js
@@ -0,0 +1,58 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-006.js
+ Corresponds To: 7.4.2-1.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-006";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("break = new Object();");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "break = new Object()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..8eda253923556b357ce25ebc11bdba005bf2be69
GIT binary patch
literal 769
zc${5PVQbqk5Y-N2j1k6!5<&<?gb=c>>$;JBD*KRRUY9QMM(p)V7)7<OshDa9S!t5r
zuphF&IVGW08G_^9o!+~9(r_GKC1id%8%(Ez*)Ne}p@rUF{BgRy@gCd>RMBRsu&P8^
zoK1vA#bu(EC>FNfwP~Wc#s@=f4@HriTUMuY&6VJ{5<g=mx#GH1-TzBQp*7-CT0v%X
zxZ2u+Ka^$myEiakQS2t!R^Jv=t`?~6@YCI5BAepF?Mp|^7}pkc3?G%od_N+|$|bf_
zwH<Mt-9H<v@8L-DRfROklvry2CSFO&p4i6Jo;y#{**LyT?8E+rzWc}(ya|$Ml#aj0
zHQZ#l+}WnMSz@NCS!E@)pN`W>1Q=XLv&7tEYh|APEAkvwT29JE_zkz~Qsou>!iB^<
z)aBt<x^c;#MVY==<+`9hxLGZ4-f>wW`^2<b;YD5IMr2&RJwN~0c-a9~t29?S#Y+2E
z$@`nWhmTx(+Tf7&j3lmExa*F1h46Zw&Z5YA{0XcBB%lrrUC#&d3dlRC`-Fn$I=~J|
z2)#o>;mDz+3&g})9RhQR106ySZU2esLi3P#&}xNEAV#<bhIHZr93Q(u*zPz^?Z_vd
gi7u^^pkb66<ov`VPOuk-Hk=U`J`j)ihItC)A2Vs-qyPW_
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-007.js
@@ -0,0 +1,51 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-005.js
+ Corresponds To: 7.4.1-3-n.js
+ ECMA Section: 7.4.1
+
+ Description:
+
+ Reserved words cannot be used as identifiers.
+
+ ReservedWord ::
+ Keyword
+ FutureReservedWord
+ NullLiteral
+ BooleanLiteral
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-005";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("false = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "false = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..18f757d67c41cd3b18c6c0130445c8a964f1e1db
GIT binary patch
literal 783
zc${5PVQbqk5Y-N2j1k6!5<&<?gb=c<%d(OWgR&1v=5{HGH*Bx_5Jpk$Tk1`<gDfZM
zZ`jY;ADfcUx(tK-ba(IFz0+joUx#FQ6^s{)aquHeFjJ{|y!c~ud$YskXNuC>ttA#k
znrDM~s!(zfDw$@hD&DPNsJOxhO>IxoEYVe!PUnWpl-~*bgt6d~t6X;f4{3$glnYS_
zGOfeqV-*;U^>3B!dqiBWP*ol5iOA#My{e#M)u&v=_fx^k0_|JB6r$<lw#s)j38lj1
zAQ8s-8qfA#(s+RncQ2Pf!&s(k#hwV-!lAq!$;U&J=M^l&D46+IVYS%5Ffun>!W)Xa
zHO8ujyBODd*G}k7quCdq>Mo^Fb~KCT9-wpM1)&bt3dN<0uu$;2C2*I<T)Z6)KMZ~q
zF6*g#iCgBX{P-|kKWERvOegbg*1s%ODUk)Jr`}+~zUMM2*jDNn{fs<88RheQWhvdl
zz7F5tj_4&%1tyJ{7sx&`B}=@ZU%7Uj0CV@FOm)V>4HxwnHOnaQyvp%6U~M1{wWw<v
zHjr09-a*|a6fDzv0xoopfWoOkNezfTSsfhx5ev=;J*I8w9)St1BQT)fskMM;;TmYt
t&;;n!O{doA7{-Zfll^JZQ{ptWXp;>37O|XzFq}h!m~cW2Vr!<J@*gw0<-Py_
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-008.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-008.js
+ Corresponds To: 7.4.3-1-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-008.js";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("case = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "case = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..b5bcf27fdf0d2a03bdef4f1dfb92203ce956e347
GIT binary patch
literal 789
zc${5PU2EGg6xA-q7$ZywA(Rq=2q9!y*JYzGqwFE^+%6-@M(lMDVHCx_bH!9U$Z|e@
z!+zZU(v*bNqX?vX&$;*L9%($8e-6p=b}^dGMvEUJ!AuLizy59Y`jcbwQ=kfVYlTH2
z^6YXdG%7AbtwfeqcxNoK#2{5quOdUuH9i`md&iaFD~TU5mRxb2tKM_S)H5T-)xHvF
z`CQ5>y&9P#%?^qYS1Ic1)_z4*_3l{a@vn=+7$TnG<LZA$=X2av88iK;G$v-OFwWQ5
z{RbR1j!@I*I)3maFAJn$ti)Qo_w!Q9PNeon?#b{nj24smZCE|*AGoqNT*0e4?qXaY
z>{8sVG1guf_|fFcoSIQesoiK2O#?vhE?9&HuCcy;P`G6*!Bv^2sMrUlRf*R%ou9s=
zUTCg#goSQDt8s9{CEF_Vd7qFcsG@wDr@eX3o~B?%J>O=7n^Knw*#eF24JPb+u9AY@
za3L|N9khL3U{m5w#9Y1}4&T$S+&obN%+ZF0mo)Haqx-kZXb}XJ?{C1)fq2xRHOqE^
zya4hBnl7Q>SPt}0K@HxW0ty}5BWFO&-fjXli#TvW=!tfrdkQRIr@)3mx6uM(gzI3M
uS~ftVZF!AO*Rtz1m)K^vye9FQM)ZvI1`cuPQ5eplPAnJ_o4BU)63Aa4#^_@J
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-009.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-009
+ Corresponds To: 7.4.3-2-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-009";
+var VERSION = "ECMA_1";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("debugger = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "debugger = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..30b763e40914b8b8f6cb3ccffd8a2ff3f103a709
GIT binary patch
literal 997
zc${5Q;cDA35Y~hV#u#Hv2qlD~g%Gl?3+*UltlL<Vrd>*#4cps(lu=asnrd@xPnMJP
z_a13av**|g>};=fIt1c$ci(s4-DxzPop|K@*gZHqJ8-{>5Mm|N?fxHadoV2@R|4c@
zl}gAmk;KDOp+NG;Q&Pn9+TR)TD5{_R+Vm7xaDz<Uk%&VC)wI3OTnc^}!65_@ms};X
z|Gx_v7y`MxttpL*Ssq2kC`y9w+XcS}&fw;9UFYVfhmh9v>R!m+0lMaKVftLoLDh=x
z+H;}kt%eV3NbNMeK#EkgXRur=H0CO}9!EUSfFTN`f)JbXf+U5mFK^5Ey_VixO4&@A
zbnf}?baw33%lN4sHWpmcrzWgY2$Yqi#auEIYvz%1U=={=vAoIHpMIDb{?tF6m`ji{
zk=Eyl>!FhZeN4;@7Z)hwrchzCfx4EkWKO2IR6b;ivaO?B<r0_+C~N^C`;y2oqfc~L
z@JLsfv+%D)#tMr`_>l`#!74@U8(;9OoXYT@#$i>EL0oJ#?9UQ*FPCBUWEpQ{c?y!f
zVM^xEieM!I9zEOH-L(rvW1fML;%`&NiMM;PXC85ZL~JQ>Rqug^ApPVtnVTOujxubo
zlkM9osebCY?@lK5M1ND(r^GT%%P};al1G&Mq8*c%)X+`(yfPg6vN9~%YiNW~g7@nd
zweX<7ODuf9Xi&Pn(Q0W;jWj6f=(N+`aBPQStbwt%{V-^+2W`75pwm~CVbEb^X!PyC
z*`frcmDvN#e%I5Rj@{E5n{AyGx1lvjbA+<GWN%9+rd3L#J9Lv6v`;jmBN9pe0#Ixu
ANB{r;
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-011.js
@@ -0,0 +1,62 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-011.js
+ Corresponds To: 7.4.3-4-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-011";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+print("This test requires option javascript.options.strict enabled");
+
+if (!options().match(/strict/))
+{
+ options('strict');
+}
+if (!options().match(/werror/))
+{
+ options('werror');
+}
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("super = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "super = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..67b16dd1c85801788f84ede06df27a073764ba4a
GIT binary patch
literal 782
zc${5P+iKfD5Zw+!2(buZf(gci#TetdX_^GTg+AD>k~-LGvDEazl(3N|&eDx!Rx4k=
zp<mTM>)Iw!C=0{PIWuQ2I~<3%5t-l22Gi+a_DiIgX`#1Qf2>Y-ybm4)s$jEJSQH}9
z&L%>m;xf`oWQz)K4Mmn3q^jvuWTd&qXG3)ExDxz9;ulOLS6myi{Xdqg=7>vKl{2Hw
z)wTlMq0E!t-GK=f*-p2j`V|;+wLo1B#0-T>V`>^kNxsDP3$T~lL#Mk@MKZ<bhqqh1
z_hBhzBgA!u)kj<>Pb1080$Z`#?!(tjX_P3j)bl8wjl-L$I_zKQ+bgc%gBJy(c>FD_
z;U>Z5?h@1}mr_&QEHTk;JdP&;pm!I{B9rIfip%3<*M)s%T9rtzxsaH$wK9M56?uv(
z&L{c8kFn4rULdgEb*W2*Y=&mjmC5~?tF)*~+=ztBkLMScjyB2kJ2$6D8*kOGe4QVD
z8Q%M>tDh9EnR^>u-1lpR=1T9nbi$my&d*FvzRu?HEC{NFe?Yqq#G@AVZPx+v4#+2{
zJA{I3S-=jC4`&C5!ii1EIS^xy>)@G3ENBvXpq-aW8!iuy3+<MF48#c6z!cSNfDW@f
ozuC6z+L1$CV{O_XUe}18kVelTmbVv%BRC~C^oUCwQ`rLY5Bh)QcmMzZ
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-012.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-012.js
+ Corresponds To: 7.4.3-5-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-012";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("catch = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "catch = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..1ae1cf9b444449fd87adaa56e29a1902b65cc2b9
GIT binary patch
literal 786
zc${5PU2EGg6xA-q7-NhH!ITh!2q9!$*R@^V${v!;?NU;2*k1P#Mp5nCR7|ylEa&4l
z?3e9dO-We24TF4i?z!iFXgm#XVluyuMz^=4=sV9aS6po`e;WP4bboo|D1*&XVp;Mc
zKb>)fl8IPJo-b;?U&B~2h0i**JLY+&Rkct5j!DiQ1b)O+Fv*mb_x|S!*`6>VYD21h
znB3OHV5EPGd{?6;hc%fnxj<Eywa21Jf3!ke*Ycj0qg0sfV{uw6(Y_BWA^Ztb>C;58
zszfJFC10wO-AFvW#pj2=chODcb}xRJnEo-<Gwm(saS~0#>$qO*FBqCDCgDv3Hz_W6
z8*t-bl1x8`4sMp1Do5K_LfOeQnFWCET@b}O+R5;dX`X(dN>+H;C>4_`!BQPxRjQIm
zBh<xLn9*;A%u44A)6HabE%l3iLYARSidnI6t{4}X0rhsd6IP<7H1Oy^JxN^Cept|#
z)~M!+b?&L+@Zi3{4NsYPdv^ZbzKPH8hw$3M6%*}$yPGFb5Y$6|g-#EM>zIybST>MX
zK;D6G5eID3gyRG7;N$=t@C}DFf#|d4gR4JcLWekqunp}4Fra?`794e(M?kc319Z}v
s3D9VpZnM=h46k7mOP_{Ai967yKB2mz>F$l;0(!)NQ(_TYXLf=725_h6O#lD@
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-013.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-013.js
+ Corresponds To: 7.4.3-6-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-013";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("default = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "default = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..e9ce0a4e5b4ba62ce8daedf263d1773267e58fec
GIT binary patch
literal 1004
zc${64@oUpi5XYa75JCtcgi=N+<ylIpb(T$vh*NRxy4kT+N#gur$aqU`ZDy9#mzTEt
zGyGfpYy3O>2fQS1*(C6C@9w^LpLaK!&W>Gje&p<*p6)x}!T@3!%G<p^%64yBT&_Y8
zlg&~<nubX{I0+>P9=TG4@x1ak$2^LvYqv68$tB!irS>R{0~A$dJ7-*k{4#<A@FOm`
zOhos87gk^><l?p}sb9>pDAGq!;(y=H>xcd+++0579PZ<99_M{MF6JPsuJ!5FJyWkr
ztF)~zkK5h7*@67Qm7k#)goFT@T|Zeueaxl57)Lxyp>r23D2s606Sqaief!1?)>S>j
z^+mXp=dR~WXGd<ejGxMZy5fR9w_)SMGM|Zonk<s0I~jY^Pcs8HOYo(c6v0&Yrrya!
zzsZ|XFxDVMB8ZXV(lF_4;<%`xPmMz!MiAJk<U)FoN=qi?V!N}1-S=X0A(D06gpGta
zNZC6kMF#q@yL&OD&svY&dn<1drc7crCg4XFA}A}d*fn4Aw0Ps-ALyV&Vi4y$57=7Z
zs6PS^KzPYXGVdQ|G84cYz+tX1;cFs-)XG`MJOzD;u(BD!CiHpqVrO?axK1@#@yKF5
zq=q#!K66||pyfc6oqNt?QVsSu?K4VDLo*wSu2S-Zl3%oG5QFNPMqigkgZ4_pq%T#4
zpa9REIyLbl8XXZ6@2^x!2V2diQd2OOSQ>3@)oshB7&9=oWjzko9tLYx*+8YO(okrp
zG<5pDYj-F?v?BWrW^cDO+qOE2+Ni5U$5T;i#BL*2j|}@7(aZvkcIjK9&_2<Lipmd^
F`~`AnCkg-n
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-014.js
@@ -0,0 +1,62 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-014.js
+ Corresponds To: 7.4.3-7-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-014.js";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+print("This test requires option javascript.options.strict enabled");
+
+if (!options().match(/strict/))
+{
+ options('strict');
+}
+if (!options().match(/werror/))
+{
+ options('werror');
+}
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("extends = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "extends = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..39f7ffa8b6102ad655e3fbd6e609e28489674d3b
GIT binary patch
literal 784
zc${5PU2EGg6xA-q7-NhH!ITh+2q9!y*R>;iDtkz>v`b06VSC*}7)7=3QZdyIvYe0K
zu-~=+H6>>CHVoJ2ew=f4r131cjmYvQ94!{3@EcDtQ(Wz@ej2_0?3jG#D5tx%#G>GN
zc0T6{B@>a7JX_WEUJWC~6h3KcXUwxyPt`izJ0>}M5cmNT!6Z|;?EPQT3RDxB+}D!r
z2@|4Dha>%4WrrOxlPgs9hJM|u=k2k`lOJb?gYjg6PY-`P@+V9sj}yVl0z0wXAJb<K
zU9E>wVS1E^l6;L$lt{i-^iM|{IM(g^pcJAN;I<ZDMsYX`Zld~Pf5Fh)FbS_5+^sQD
z4csNTKDc(H=_H<g3LMQXg|g#WJfFIE(=gISKnpiac(kt`C2pyuuuxvC!-N&s3v&9b
zL-j<y&058lYbW$QRkB3qnsI^Y;JQ?$L>i(#`vz0`HJ51twEfTU72Qhx%pZ}ZDC2yd
zuNsA7QXSU8OHbw1>-z$CJYnMX#pOHaGt<|R+PBf={cstF(`jw_3!G9Qu46f_Y1lws
z0C@wxO&qXH3(hOx!rKZsKn<7lf#}%t!O<VFphKLhZNq5=OlVcWfQweM4MYn!K$99K
rK=;J-nw_p;G(4LeqUrj?JJX_Fax$=p<s5~f4NYRgfEdKqOdrT^F4pFu
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-015.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-015.js
+ Corresponds To: 7.4.3-8-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-015";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("switch = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "switch = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..dcd55941feb9d20230c08452f62bb28583c4ef85
GIT binary patch
literal 997
zc${rgZEMp|6uurpC?SLpMk%F?YbmAHSvDy{oQiAL&5o@~6X%B^<1RVtqFGXJZeRA<
zpX9IcclZZ9Np#sn0ypR7InRC0Id?Fg9J}oNXu5xTx<CCK1{kYQ-R}L;wmRe7xe8H^
z)^mwz8YXe?BvdFx<SH4)vohWoiYO}Gc4@jwD7+!2<{*p%Dk^E)XF`VJGQtD&BO!$%
zc<bL-B8`j5B8oVb3wc`-8-pnEziwsxp?``um;ci_#Y|)w@9)!Z7H4`qA!n#cHP!Le
zoz_kXD{D7DJ`}(Sgi>KZl3hQUV|{|FGTrp#?NBKH`i`}lyTeE<QZ!v(hI7^W%aJ#e
zvz)u$bUZn7%Vm7m4)mpv@YE#gMWifuH1x*rCss1gMwXhmo};fET>F?u3~%h6jI6WK
z)Fqgi(z1NTjGOFwKzMAfP|8GBBV32Rh@Nfl?Aj_Rc4{7qFv6gsFjehI!tY4Ax|Yc*
zc2Xsz@+fO($52o&9|Uy~0EZ{WoH&%tI|RlRuhS0Gl)vUmE^x1cOA&Ps7iuAqPmvm5
zV!%HoGD!JK(!$=M2vB;-Nis8z-JOem?SB2zyAD&H>EaT<EkYUwFDAghh^0vLf%g8)
zq*pY}G0q-SaPCb<qjI7@p~Hb$rf%7$p#ggY><2UqW`bGKVY4u7cvBb_ywo+;0Y>Mm
zD%kWf9eT_n|G5q@sBhM_4UJWRRVz?+HXO?V$`KVf*284uezIW|7iiEd3=`UgVZc_)
z=>j8ZIr;^mciWYkW3@EBQPY?~r>SkQ8ug(!S+`qZx}8gdx6mh!ZDufyDqFyQ10f0|
A8vp<R
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-016.js
@@ -0,0 +1,62 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-016
+ Corresponds To: 7.4.3-9-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-016";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+print("This test requires option javascript.options.strict enabled");
+
+if (!options().match(/strict/))
+{
+ options('strict');
+}
+if (!options().match(/werror/))
+{
+ options('werror');
+}
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("class = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "class = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..c824eacf8091dead731656ff0f117113eb94a0b1
GIT binary patch
literal 776
zc${5PZEM>w5Y`T3j4{TT5Jm|_gb=c<>)I07hq4bz=5{HGH*Bx_5Jpk$TPmj7L6-CK
z8}@tl|E44~9z!7R?z!iAPN&f%yo<^FHX6=m!{`UkFjrh{uYVie-ejNr<S2v9Qes*1
zB0ryUg_4O_NuDq2dbbW^#S}hkYJ0@<On22f-FqfEdldKyQ^6!ty1ny%t&puT6QUNR
zT8GJPU9d-@NPqQ)I$7j9ry3g6#e~TPs@l9cW-5Ie3s#j#bsI{BnKqBpVu|)cSP9|8
zspL!5c|rF+d;BECb?wql<aV!ieCydR;^_>ZAOBs~JWirXcpKM?{R0DY#U#A-ag*Y5
zw*dz?OH7rcIh9au9E_96m(Wfo$ut0T?}I4TxrHkx8d*U<QY9<Ac5WCKm{|%-<*DNE
zA@GK-rT(GM$TE~kF)bF|u%JgPs-9%A&Vkx@@#VvyDR9G6Cf;3Ke(-2dgSe(%q7}!i
z#QsgCDv2~gy^R%S^m`$*()r5tb~3+IOsZY0f1GKaL_ttL^&7Na192VO@eI=f@(Rd%
zXj;Sp+q9v32t4Q<0te0vhg<;B_h}PceTWTh;v8V>g=qji1SXufy;C4s*auDWO@Kzz
pbiI>~VfYP;nEE!H4slPkC?);AMQnF33|G)22DFGtEX~wY{sq6*;{^Z!
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-017.js
@@ -0,0 +1,54 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-017.js
+ Corresponds To: 7.4.3-10-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-017";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("do = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "do = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..a170e9cffbeb9cf8e33c3760601fee153d1b560e
GIT binary patch
literal 786
zc${64ZEM>w5XZH{7-NJnp_mdvFd>92>$-O2#h~m(lBHcr;tkvDUX)Q(`<jZWc97*f
ze1?6peXA)ktGgi(r@Q<A?m^>Oa2=7`t8lbfjKUv0#Y}OvyZB}F`m@91fuo#mR}zbY
z=h^9;E0jz`O7d)3`#WQvrP@<#dUY^TOyQFbbZ?mC>|Wp}Oazlm<+As`OXs&HOo&?U
zYc`X++F_4Hp8On+^kbRrxiOPVRCVos9jaB$05>n7It8V|RM(G^e1$YhBwwjcEO!&8
zlE>$!Pxcm17Wj1kaueOZfI~9}gnbv3LU;%HM6j~J+b9la!Btc*_BRa8HIwkhiKdfy
z_9bZGHo?_?Y^uqnP!zW-Oq3nZ;`tQNxtWHM&TBvDEeNsmKl)0Rc+n^nlPbnS!E5@J
z>1I-YBlYimMwX(C^Lf4m-%>iE7v%nP6<<Bde3K0>OI1qrL)25Owf1{1)52AG^|SVM
zbbdGV1a5i4#M`s;53PUeTexO|UNSB)b^X4E;>LIP?M#@SI}WGQdgyP^JO<)WgSw_|
z0eJ=F9e6gOU>OGVE5n6eWl-ptlpF!kchdt$A7Vg@&?;=fX=Rw;SB4G8E!PL4!41%&
u6BD4(H5|9oHO!-iMQnYWv`w6@hI-`vz#@io0K)*zhzTCCiKUfoAb$Wws^?|^
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-018.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-018
+ Corresponds To: 7.4.3-11-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-018";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("finally = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "finally = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..2c200841b068dc8992e4192f3555137138bb1b58
GIT binary patch
literal 782
zc${5PU2EGw5WFrz2qA<pK^SAgVT^IzG);<MO6Y^_Dyf657D-JXObHih>xf<?b2|Cs
zH}qHapY<%!C=|i6Gpm`Ky_?Sc+mNhog2{3@34WvrW-^tBtKZsSIIqCZ6ot3n2rP;;
z&(0UAM8S9{MVhS}zBf&?L@|wK&<sP#BtEG@|Bi{2J#hSlF=v9wTnzrF)c;hOF>z=N
zx--Uk1I;PV<6q;60_*JP8!@p)*_=IWMvdz17$c3B`1J5{BlF%bId^AF#*Z`3$^v_l
zI8^XCw-v@B-N=rQyGBUWAt)p!YJ)J&H`xD2RPicm6-L3_zX_X*{R3lt%LKf!aKFJ=
z+Mzd#=3o34?ql2>x3`pk$)y?1qlIVRc|oYgfCg?EcOoq0j1}m}ynX_Q4&|f39W`&m
z%lmOhfqX|lQYlKj8eNyN6i5S9!M2#t@3}|{x)bUVKO;*}MEN3L1GTPM$}zFNGPOd|
zerW=)U5@)SX8i5N<%d=wnUKd6hE!$X=kz%^tz_9M3Ouh__#2$|fY_F9*@k8Uc?IMh
zxF)f{&~!Mf8yh-xW5KCzlXD=dQWq@s5gmHOs>deu>&Afhb)&(c>-2#r;}$4UO9$w7
pG{<T8HT|Szl4CV&mpHC+qU2;`5Z$VbVF+zvz=&wXRLTn=e*q_h<>3GT
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-019.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-019.js
+ Corresponds To: 7.4.3-12-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-019";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("throw = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "throw = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..1455a60bb0199c2e739d5ef46bd6d622bf188e92
GIT binary patch
literal 782
zc${5P+iKfD5Zw+!2qA<JK^SAgVvKR!G);rwLLY2bNgZspNNW0EO4vvfM|2~Z)ykJ|
z=vVd6y0&N(%EIp1nKNf@lUZ;Zk>yP|UM$Ap&n(4UW^#Y^Tk8*I$IoMi!r!e0mStAt
z=krXWU_6o{%U6xP-@r&RiO(vuJIV4?u^OG;9TORQ;P@F6&IFT%=>Kn03Y{tAyb+{I
zhlzb-7>(7l$`3hWCRQk$4CaIv$*(~}Xrinr5!qVyln;f(^vH~oVvT2qlCxxi&kwJA
z^`=ZFPgBmS63zRd;=CQ;w()mku|HB?I;Q`$RZ~ahWfX_A;3jGY`v*q)h6#9QNB%UP
zeGM$!tuc|760Nv&ahKrwFa$H6#d9CfzVpLK@%lkQUz}7viDH}6tx)Uuf-FT57xQA}
zmXZk>V=0H%m8=BP5LHDROzDq8q@{JuGLESs6~j5urmRHk8&hSc25uO4WKplyp#zlz
zx76df%M!-lUtC_m+g4KKrKF#z6cx5#f3AR<x6#M@(J~HwziIe8cs(GtrCE-t8$jLw
z`2e0tEHHEp1~qWtvIZ8kG>dpZ)P3TCtq#%Pf>^cNfOZW`aBH9g?Yb=>O4tPz)YSpb
rJG$+j_B8FpF^H~i(`pl2RiROGIy8u8ABEuz`ox4G(TSlVJ3#&dOh4tn
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-020.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-020.js
+ Corresponds To 7.4.3-13-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-020";
+var VERSION = "JS1_4";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("const = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "const = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..d8b499cc9b6e1cd58f11b849aae54bafa3ac9b57
GIT binary patch
literal 999
zc${5Q|7z1v6uurp2_b|MN*JY#>nNqxS++4moQiFi&B|IOiSv&k<1RUCGt;Er+_c>j
z_&`35&*2MrlelG*z~%h-&Ue0ZPKM*@N0(fjI)lk%;Cu@Mj72DJkNzmT-ErYuhsf>C
zl4F{NN!&jR1#%X-f`{>}inm5AiYm8LnXX_07m{gb7{-Ats%SgsjEC$h!ejI!#+i`t
z_W!YjYnRh3il{7S{I(+2hEd{w-_7|$e}apvhdQ^vJO<zCb}$!R#jWx6y}<53hGubY
zR)E7Q=rKM+QOUPPO!)Ir#Ih8rgdrCgNcpaxEOE!<w?+P*zB$Ep#jCqM50|2SS62*E
zR9?8AGoGHh)iHi5$F&vX@Z50ikvIM{HIik%tJK7ekA<mA+AI<}ZkFf^%^Q1XwzkOo
z8|Sv;${Kx*oF^QR=&3xOFW_lsn$UX&D&{;{$J$aJR@6mOUKpO~_GmJ=+&5FfxbQF)
z`Uwjo3|bLxLZ3x1_73*@H))-AB>}E!J;#h#imJ%LpP3vmpldGo{{dNm+)K`q*%rpx
zg1)7KXLzLIibX4L9;P&}p&Wl?p&W>oW6~S8Vrj9i{=dQd<p>nx{8tHjCz;4NQU~QS
zSF+vLga@hhpa;+k&#~=lr@x`Q1H{l3!&G$*$P*yHprsKVbX9@f(lDV@8V0<pDWnTT
zzAr7P%a159B!={94d6}FYAFqc)PU4g*lKQ>h6yrPlewnxIN5lZY#3z&4SJ=a!ggus
zaM(6`K%}$+{aT`5QPnbywo+^5Ao;3FgIIEoT8HfQRHD=iY49HUM1?ldi6$!#fcym^
CF(j=3
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-021.js
@@ -0,0 +1,62 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-021.js
+ Corresponds To: 7.4.3-14-n.js
+ ECMA Section: 7.4.3
+
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-021.js";
+var VERSION = "ECMA_1";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+print("This test requires option javascript.options.strict enabled");
+
+if (!options().match(/strict/))
+{
+ options('strict');
+}
+if (!options().match(/werror/))
+{
+ options('werror');
+}
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("enum = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "enum = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..54c04c3abe44cdc433b6b6075e3f9b2187160230
GIT binary patch
literal 782
zc${5PU2EGg6xA-q7$Zyw!ITh+2q9!ymvvp=${rHW?J^Q?*k1P#Mp5nC)SGGtS^4@6
z`&IjAQ({(+A-Fm^y64=htI0I@6p_VEIG)eP;rA@XTxDv1^~>lFrpLoWhSJ}yB$j1X
z<fB=pP;wC|ndQrx@7FL=T;Y?Jb|+b$>a5zQf6HaY?*)FqL~zNKPVfEC6|&=TA!<XW
zeYo7$#9*wqWqznplb1CabGbxSm$fINNPe~h+}7zdN@TWDOsh~TOm!DgQmoLv3)Vuo
z9#_euC-}O=v%`b3WR6ew|4yR!S9vr)YP+%AABE2&SVVC+4Q`@(u)pEb+;9o6oXGd$
z>F0oIzqL>lcPmU(6L$%&4s)^NX*}}*om)SQbY6oE)T6{LgO|W8+;G9RQh&xr<SELy
zm=(*8z+IMb@%sGY-RMV2zi{1R+E7LHTf^(MT1#Xh>c%&ivTub<%YIO>=b}uPD7JYc
z#!`8_L`!MVEESjPKvCbDkMG{PO77WvrsNv0=rzv-rmdP<#G&uk5B>@#Z6FRcXv4Nl
zATNNt0oNiFY}0^F1sZTx0SaA%k|7Ws+b%eI5d&O8t7{X^D_}#f0v4S1T3sO8xCvTx
tVgig#O{dlA8AhXN5=%#$GU71p<dXi-B8GD`h6`vC8(PF7rdAGs`~k^*<$?eJ
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-023.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-023.js
+ Corresponds To: 7.4.3-16-n.js
+ ECMA Section: 7.4.3
+ Description:
+ The following words are used as keywords in proposed extensions and are
+ therefore reserved to allow for the possibility of future adoption of
+ those extensions.
+
+ FutureReservedWord :: one of
+ case debugger export super
+ catch default extends switch
+ class do finally throw
+ const enum import try
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "lexical-023.js";
+var VERSION = "ECMA_1";
+var TITLE = "Future Reserved Words";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("try = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "try = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..b44f90fb48559645d24e0239ea3e8bc028360e75
GIT binary patch
literal 763
zc${64(Q4Z;6o$2fF~$gEOfV&cVnPU6*L7XVU9XbN>(V9Oh`ru~Q55?$6;<sZD^2nY
zeT2U3l$gb12&AK<|NGC8G#p2_F`3`Y2Gi+a_M2yzE3S6euST~wK5QO1%5b}qSeCrV
zFD6`}WFl6Q=gT_Zt;1L`h0hvo4|$$xRqfNcW0JFlz%Q5zCYdT^_y3f32sFs#uC{EA
zm=N{0H_*#6-`A*<{W_U2xkOc$wTGfep8_pFsW8(O<Fr_zeIKobpm8esO0^TY8!?qW
z9^3Ey)gR~s;U5$u!PX@<Biz*0&-WNlr}(`1_qpbAG8;!Xas9Aw&^KS0gbx(AD@>IW
zhofZtBl2*Y;%a|;s@b(rb}~*TA)s>?&SEWq_nzj0g+%s5e=^-$W+^O{FL29KCO%$X
z^@EMn-}4PwhB7H8#nQqTCK^ZX+Wn5ZO(C<=zKuWM_uWJrj97`TDyko)Ul|veLC}qg
z;Mh{29%Zq~y;3o$_KX|!bP6}YJeh@IeY;=K^np0kq^@PyK;8lQ1inouSf&ZhDsZ7w
z1r*wbLoR{nx#a`ZgP3qmXmxDESru4tQ3VG0t;Q)3ZR~-DPECLyFrCIp$1q&aCi~fP
dI>hN|(>CdzS;V9VV`#t?vA`n+u{C)D<PQdv-q`>E
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-024.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-024
+ Corresponds To: 7.4.2-1-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-024";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var break;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var break" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..cfd62f652fe69aaeea4dc18cad637d04c82976fa
GIT binary patch
literal 759
zc${64QES^U6os{mF~$gELNO(TB0>n+)^%OUp8AwzUY9QMM(p(^jH24Nsi<lPS!t5r
zu*d!3De+c^VGvj6_&d5+8jhpun9Q$cgXwfI`zbQawb0wkUsks_-f!*&s&KPZSeBy5
z&n7~n;xg7s<cnHw4@I6CrDnRd8EdZb$r#-mt^~i6_z6?V71ze>{I3<NHR4j%I5XK?
zZEL|D$|8O256otf?{X8a7O3m9d$n~y-9{@ZPj}6Tbc#=RhjRrZuG5E+<f{^yp;2kf
zOlNUgERn{k5=-5TaD6awqPBbJWxCEkZr|RXoX5#*99_lr#r}rA{md1-rMOvQs=YWI
zCF5^V12-uycNap<0V}E9WSmSwK<_4;#pVb4otyZ~Gcda^l&_2G4FZW9k#hO&{Nf|L
z_7g1ih?nSp#qGLKSxG;0Au(%|nk&6?fw8qRulNOdhAJs0#lpRgKiu}aQNdoiVERE7
z>)gR-E*)(!pY@D{Yv%v$;BubK!mys~2b{Ekc+{r8W4S<H0eKIBLnyeG4aZgCL$4|*
zoY<7Kfta-$fM-5pLx<4Hc7aue18=Irf=1i#05QQ0Fwm(DaM83pKj>KYQNty>)uG44
a3rrFtEyLN~J{XSRoH)=V7I6)E2ILQ@^xaMX
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-025.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-025.js
+ Corresponds To 7.4.2-2-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-025";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var for;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var for" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..51f1b87558862781fae3236ffaf32b07fba6ddcb
GIT binary patch
literal 759
zc${5PU2EGg6xA-q7$b}^C6o|~2q9!$*L5ZArB6xbcIgst#9m**D5`y%im7&xl{)zi
zd+Z;clC1R@0_lF7b9AmW97oqNnP1HY)9GOLQ)HNHp*I)5t!{6;OYQ}#aJ^JmmZHc{
zCqkp*GS*7ui@M$(iaaxwn$xYDvE~{dO{06mmEd<0KVvGn;@UJj|JMrD8gVIWIy2f_
zZR$dQV2(w;RZO^ApssIqhq6e2^=d%PYDQSqnR^?pq@;1G#8P(*9+k#y$Bxrti6>jr
zBAw#n-M{m*7o>5$!!<@+rw=2^S0%O+wb`Yw1JC1RHjb|1`eC1;Z$EJb?*d$>xZJ*g
z7l)%{{4Jv9j+N9D*Go*bn~al5=-q^~*z^E{QgfvfEHyBC$%Vws(I)f1;-)H8R{BPk
z<yc+#y4Zh@&wBbnVa4coZfs}XUj(a^`Nc2DGgL`2DHiT^{PDIAZ@W>!UTrbMEvmdB
zaV=6V-=Cd-a`1^uf9qkyOPnXOFsvv00Zj(Pqc-&{*8%bd$OmXRgo10?aJmmX=<Ndv
zO`DPch}pXh@XR7M91yy1J1<NNPWFKd?M~1FVuS-Qq%#|!)wcZLuw&T=zC&EITl9$d
bM@FeZ&W{~pdplw103#M06PGxKc?jeW%BtN}
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-026.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-026.js
+ Corresponds To: 7.4.2-3-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-026";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var new;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var new" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..beb136edb6ecfd09765ea907c5c8eb7b370bdfc8
GIT binary patch
literal 759
zc${64U2EGg6o$2fF~$gEObMlgVnPU6*L7V9?4nmm=5^^3Z^T}2!YHbJnu@7*kd-F+
z4ZGYQ-bu37V;IZl<2{dGNrO>*ov_)}v_F~jr$1zlg^^}+`OE5bN4w-+qK?)Jja4Pf
z;%qDpYM~ONWihYot${3Zs?;-`x|tYZ@R1sw8=<ARQ}_`xCA2WqZ2w;?bx1IwH#ML+
z6iU@;w@;sWu_e|;cc9AbXRmIhLeJ6EhEBIOWH!OayMK4oO7&(aO!n~NvP}%s2J;;;
z$;t&bc8Z}A%L?7wc&SwQEF$|m$x)1}n#z+*%Y~UG>2wrdCH2AnhMxT-G`!)YTq@%w
z(J&o-jRRa~xY!;D$Mpg;<EEo@907Va(KI0egyBll;eSSvqfX0lIp?2*RG53j3+e5|
zW%xn~&4Vsi1^*_<XYO7n?{9m)Dfjp0r&yVxs4%FE&}N%86s~0^)Z6om5AfRmf}2&T
z^U4pq1j1G57!vt^|8(i#lTfpC8b$TazC$|%=5d?*j%xvX1?(L(9LB-5Z0PI*ACC6{
zhZEalZD6z>G=S5?YzP?Nx2@+%2afiE3(dpe2pE9_prH#J;Jj&h!ExKN{R4}+v^rjc
cdE~-wvDS&hY`z1-A)GP?y3A!3O`ZY!0|{5%Q~&?~
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-027.js
@@ -0,0 +1,61 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-027.js
+ Corresponds To: 7.4.2-4-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ var
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-027";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var var;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var var" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..f76f986ae52273563fd8af506af06b0f7dfc70a7
GIT binary patch
literal 779
zc${TXVQbqk5Y-N2j1k6|VnztX1Y@$U>$;K;gR&1v=5^^3Z^T}|gi%!cmWru%kd-F+
z4f{#^b5mkgj}3wJba(GP-DxyQu2ZtOnh$5Q;rtsfuvA>_E`J(Pe{#5d=P2XtN@88}
zsyv%=g_4O>NnS47c+|pFF@+DB+8gn*&{eHYc*7)TcLLvIE|_GhlF`2*tq^D;le<>3
zJ7z+(*TGO9%X06LF}Xz5I@lvo<v;puLCdmlleG|mPN7s-Xx}uiR!Gxa@|6nz#18_8
z%;~-pp3m^%?(Y%!W2W-^v0&>OI|**uOfQqWL-J_^i!_^0lB={G>@OIYk4(Z#CymG1
z<a6TTHpkVzZK`F~LQ&kVFjsaq$)>S$6VFp!1!&<T6PChSxu0;isbo=mwPI3b`%utV
z_YyY&{lat~g{!LOhkDv8$Sdt#uJN6cYYaA0f8j@D1<I_NR!a!%>-5d-fPP?HU;!_D
zfm@z4@#_5It-Dtrvl_$ygf63`3Z5PxX#Z+cF0y$Xx7~h)&T}9RHK=3S7LaE^UW0EF
z3YKZWX#*UH8bHA}9HI$&@A*LWA_jznHfam`4KU%N0XB3)uM0#Ad!R|432+{muIGn_
lapYRW*1PE(6Zcpv^~l+YMGSfnh5$OmgcD*DOEZsv{00*U<<|fJ
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-028.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-028.js
+ Corresponds To: 7.4.2-5-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-028";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var continue=true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var continue=true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..16ef5b402949a25ed68cc59d99f6e813d269d310
GIT binary patch
literal 783
zc${rfVQbqk5Y-N2j1k6!5=tpWgkZ9+>$;LJrR+nJd0o218?o0fVHDNAredlcWTi=d
z!+zHO*p!4;V+?_~d+*-6JE=cRu2V9-n)Jrw-sFcUu+&1YFMl~vXShx71*&*8S6J7g
zDo;m3qvA5vN|ZB;xB8+i3}Q8rB~#5cJ{qEZ!<FE75<g-tx#GG~(Z7(XKOAr=t(+Ne
zuGSXt`?AV^c6uh6l^b76buE~2HA8I&YGrCY;5vVJ8K=2T2a+#pJV<b9ZQ8~LmBwP*
zDb1@n(ll3Mu1_{<k&p55?(cVD&jPc~w%or>7E(^rY%)x)Qv0yKq3b?z1#cR-%5lC~
zml}_S)D%~9%yp2)gKYRU@v~tzii4YYl9~+A!zV5yBW3rCGT-Rf2d32m{p<AoZ5Lj5
z{=;21YR#3-u+~vhv6q%iKd5S1dfE`-7hEqZRn(!bcHc_BakEXqmdbqgXXFK{tQu7_
zVDu9g5{r;^i~%lLQ{qbGT)sU!zX&&72E4{;Hi=`q@pm|C0STy21IKfLyaMtLnm(c6
zIX;~2g5VjU&~hm`1Y+(^69RLH566V=Xcta)fdfaoz=Nn6ntEg003&L+00;X{7`EGv
l+t_o7XKsfw61I)$0XaYRh#zc?VGmA;1N+1yu2C`|e*o?c=4t={
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-029.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-029.js
+ Corresponds To: 7.4.2-6.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-029";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var function = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var function = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..d8b81a2aeac1549fa24612a40bdcac43002473a0
GIT binary patch
literal 779
zc${TXU2EGg6xA-q7$b}c#gr0?2qt7**JWGY${v!;>(V9Oh`qjqQB?ab6;tgXD^2nn
z_LKJKro^ls8v=3e$2sR-X*7wi6SBCP4`;LC{F}(J&_eGne_Gw%<PdxpsG{vkVO5E;
zxR?r!ipxYRQ7oH$w}FY~8XpX`GZIB^x*DDEhAYAEB)-Q?a>aG2y8ot(0y9Lec8z3v
z%%yBXcO=W~$6#oJWwCckxmu!be0oi(VbLU0Vx`ab^NDPR4|jhr=HA9@DNkbDG`V2R
zb#_0Nd|hEDRl7s@v|eaTP-)B$(<E8BLiQ(RmO3OBNjjgzS4s1*zhGcLas@A_F<DFP
zCDAyYe2yt@SD5J*ZZll%AHhv0=``|gqIqJ<fUQb%rBkdlFb5yG3?yzv#^uZY+dlom
zjdLCvWu{QCRl(jdt=4$yUMH__2mUAAZAz6_o&P$zamk)cnZ8%$rttSRV_qRVXB%aH
z{3G%lRa#EVrLW8S^XUgJB<7Aby*}$1CT`dwokvl#?N<mwARe`;=Q<XUXFy&-;1UXs
zZNqU5JUFcZ1!j4q1;pHE0Z?;@4M&95WeYB9;6hjf2TqvZ0b+z(U`T-t&_1<&|0J}m
kqn1S+bGzO#@z0HDn{>|{V$*{#bl?qfp+_8I8D<~IZ_GI4#sB~S
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-030.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-030.js
+ Corresponds To: 7.4.2-7-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-030";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var return = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var return = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..934e584655966ac71e213f868ec31cabb39e2dae
GIT binary patch
literal 765
zc${5P-D=w~6xI&L7$b}^!ITn;2_a-%*R@;jdX;2emoD)}?DZy$qS~jam}&=EX_9By
zL+n+j#H<>_Ab-;LbIy@QljJ5Pi|hGtHXF`=@B&N4)$Zz-)$30Vn+J|E-mWCpHLuF^
zDOV_&NR{N}(wz4UOchi3q^+G1FAJ?QIo(?(IlCA55p%&LQ<d!ff20#4ZDew1BHLpo
zgxL;;`nN3iH8Libs7wWSB&z&p-w2G0rn%%R)zutIg~dUc=G6+_yJRgyCzHD|Q~Be|
z0B3u|^BF$f|9c0~-vr(I!GE0K#?av*WGvXa#zmUVC&_hcF7`JJ>}Mw7O@P}RSNn0j
zG#+P@uL;HN3Uftu&RQrpn`G12yN&0m<^bs@#swCkz%9?2czf~TGTKP}8lRCBD6?u>
zEn7M{lBm|Q^i|coQBW%;Rfe^K*Yq3HtrzZ1dU-eSqrQ5SxQYBdIc7CN<bT24rjkY7
zORDIl!AR?>P3b7DbMTpo(A2qFWb-&S^L>Xf0^(7ddY0n?c?IMhgf5}r*fz8p;6bMW
z6izLVw1Ma~41wy8*w81mp<M_XV8K}f9EjS%5fB|5fHqy&0PnlD9~^frtL3}I(W~X1
d5dT<*c1Z8kAvQe(!x40e1t-KIu6CXS`2)}`;1vJ>
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-031.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-031.js
+ Corresponds To: 7.4.2-8-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-031";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var return;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var return" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..dc599af3ffa88776bc6851cb3233176ad8f64cda
GIT binary patch
literal 771
zc${64VQbqk5QeqG7-NJnp_mdv5g~-E>$<MXx3UjO=5^^3Z^T}|gi%!cnu@7*kd-F+
z4gD$olT#d4Z$oh0-K*zCcN&hPtC-9$XM^c<F#9Po%(c+lizlnw8&}1hKoxG53d>Ry
z`RPPxR9wbdiF{G_+e49Orc*QBT8uT<_+W(YHCKY)O8kVW<cez}cK+`bsx{(L);KfX
zTy5)yJCsHGt2Z#kBH#JeQon8{TrE)74{9fBJK{RMe|b(b!gY;y42nu)R=LM%vBaRd
zKazY^qI(mqq&(TdBAw#H?cZymajL{pvp*JQrpjO*C$n*M8P|(_hQ9sC6}+JaT}kc5
z;V2n@iyF8|ak*Ov#my2^?Iz=75(0YH;Vd>60*M=ua{2b`!#OZVW2ybbgb^<hUi-S(
ze@Qb#i5l5Qrqv3&QNdn}nZ8%WI%jKT{_qR(3{_H0ibbQ;T<M)x>mT^SXFY@9nmPE$
zCH>5W#EgFDX2{I{iraOeveLbZ-{17-$t(=(DStq_1H_{?^&Qs&@(Rd12pmGewQOkY
z6Ccj^357G85(Ajn4!|>q*l<ATUbf(5pEzdjDska7@S8x4aRUr=Yy)&#mggUJEW2@F
h5!XbAGUBz2(;+!Lc8Kj&#&85Z;y{zQ#4=<6<TtxF;d}r9
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-032.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-032.js
+ Corresponds To: 7.4.2-9-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-032";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("delete = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "delete = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..349a83f782d6b667324374e3025144c9af3481b3
GIT binary patch
literal 763
zc${5PU2EGg6xA-q7$b}c!ITn;2q9!$*L7{)${v!;>(V9Oh`qjqQB?aj6;tgXD^2nn
z_7nDJr^GBCLm-{|an99|hU4fqCi9!wU^*SleuxZnE%f&Km(}f!_raq;6>gRa%Tg5i
z`9x?`T*g|7d{O7SHH<aa_-v@{p~y4SRqJ%`xDxz9;zvv+S6rL+&i}bWF+=2PTT8Y^
zT*^9hhq6e2_68<c<hx0Asb41(t`?~4;b*&xiFAt35C1v}MqH;)Bgt1Kb_^Sp#%w<z
zPKzZTN4Tz=X`Cvt)a^uV_q2mo_Lphg?0N2ew32cjC$n*M6W0&>8~XMOSMY`!$(7U;
zH%m-)12-uyckkiF;V2n@jof6MOhQ2KE}X?Cb~Kh6n4g$q#7p#bQGG&FJhBf=s}){1
z4v?*t`KZsxGgL`2DHh$RV22q@KdEA!JNUw-{{^?}LS-fW#*K%}XFXHJHEWcbE4>>>
zKXD;33nXqt%H`XOt1I_5et+MG*Yji+hPAuzaMA|iQJ4CTZ2@@&<Q)VKq2SssoL9hy
ziwaQaSROeAV)l~&s9D5?CZSc?g0l)Zz$#!vm-)v)jBo=Csci!sAK9MY=~z~yX%XA(
fju#N`$cVN`aOx13?uDTRJ>tM6v594v4IqC2>e${D
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-033.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-033.js
+ Corresponds To: 7.4.2-10.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-033";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("if = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "if = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..192fb03acecd31c97ca610309db20ad6e0974e23
GIT binary patch
literal 754
zc${64VQbqk5QeqG7-NJnrkD~!5g~-E>$+~sx3LdN=5^^3Z^T}|gi%!cmWZi#kd-F+
z31feHO3dmp1mg7Gy^rps(Imb}$l`iFoXv*w?;^)S3%!5$+v@cv$HNbSD%!0TR+T7=
z%c;<)xJ<MX#j??RO_*q|@xfR-BT?k0s^Ro*xf1+d;s?wmS6rL&?*Ce;+G8$d17wE7
z)xHtjku0;HgP}Pri^EMRS4-5*J^d!txWX~l*=j8Lrb3!zO00D&#%)t@ap+uRGkm!J
zcjQj0_DAc}U|oYpr7=JDk!0l>*<Z;_a}?aWcq8Q^N#~RJI%yvE7re0_xq=te;5Slx
zNi<F;U*Z6F8LkfxLUFgoOuOkMokoD6UWtmmXIgF0yN%|FDfUyW^q5!Z>$3g{`jwjo
z@}SaO=|h%&<U(TJi%a%IW_qQ{ZQ*~${kBwj<=`WiKI<D9w=9&n6B(B;uig%Tv8^&c
z{Rw%FDlMnw($R(r&)u8k_1$2R&ZDRq>KmMPfOyoVf#X_0o&k9Up+hLRwhg^H2;iy?
zC@_nX77(+ahv1n-Z0HkOr!8pLfdglC;KJ#d&wv<k0LIj@0sPSR{BGB>P6CU#W_M_t
cc%gx|$jP}wZ0`sLAG*YWOX3pCI4^+w0oX9xbN~PV
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-034.js
@@ -0,0 +1,58 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: 7.4.2-11-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-034";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("this = true");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "this = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..06104811d33696546dd02fd9879b2af77e820c18
GIT binary patch
literal 752
zc${5PQES^U5Y`T3j1k6|VoC|cgb=c>>$<Ib+EbEwUAn{@vDcR{ifZ2yG1U&TQYSxP
zPy5qTVpfeIINjZM-*<P?Xp-EdWN|$o&St~;cV1wrxZ1t{ZS@C}L-2#6jJIovb<L~t
zV#*atCQ>DNxitCih?j-V7*5}SsbUHrG|<0glCyh(A21h8GNr-Z|G7#=T8zn^5$KGW
z5GEW9^|dVbiYDofM3w)%GEm0k5|tU~d_M-yXZUdc??yDuC10y>%v8P_3%04zy-PMi
zoFv$ovPcV~R9NV7)4W<^H<P;q=V`m%-;%>5hoVKA%_qrqY996%ys;mdgcn{KkF&{_
zgz5$xp(t+Gn5zJ{Ij;Bb;%1X<8hf|#Jk?c!=0wek3j}oVk%_30`X@diD^O<Dv|9QZ
z)@saZ^rL}VNo=A};Fjl1yu5t-j(%jCTR`N0#$8j%qIPf6*LPR_q>7$eMw(YOrK7YG
z{mS$<g|DjitKoT2D<;*x%Oab{v03RG97jMrYEjR1Y#`5oyn@gn6kN-KPV0EkYaI$*
z+as4iv<*X``Vb2uLR;8|)7EjJ-#QMQb%P!dEgXO*9oYc>i4_E$o@M(-HgU9dy^sXw
aTJ)40pE<;$2VwBxgt%})9Aazc0LUL??ArPO
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-035.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-035.js
+ Correpsonds To: 7.4.2-12-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-035";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var while");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var while" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..45bf3486c1671930914f7936101a1218c3b854b5
GIT binary patch
literal 767
zc${5PUu)Yi5Z4Z4j1k6!VnPW;gb=c>>$)!NrR*Weye?hhjo9l;7)7;jshDa9S!t5b
zu#d4XIwfXx7zT0o`{&bXIF4>&GQXY;rqjXfhsZG3LT|5rTixDx-~1G)!p%})S&AY*
zp9qbL%UCOsFKWC!6nSQl+S9GcSaXe!hUnaKCHTF>kC;lXxGq%pf5_-tBQ9laXC|Ag
zZ4J0XS){-E1Jf+>U2ekF0(JfGUQN}mjsa0=%=Yd$EtW{*REec#{}?mN9&aaVJK{Qh
zc%J+?!u7!bchO49U@sX-zAEu-rxfWFAMX#>HII|oIJ%DO#r}c5{lpc#qPSUNsvEdT
zak;xSHJ+8!UL1~+@z=;r#>pfE^lrmhY<ghbs9?`(rXN(X&iyaAT^A}V*;<*G`HVb6
zl@ya=;p?J$q(-T^(g~K@XFcP>HFNNZ%Ru5rq+Gtfc=w)u;zDBPXrl^HmdHLZtyb7P
zsIUB8#)y~b-o$V3`tXu|<7RQ$Jeh@IeZ%k2JO<)Xm-@El0C@rA4FoQs;8-rStHOu#
zs-O_ql(c}Dvl)PAKH@@y(291TQx!HGRfPqYEk6Kaf*W8=%mz4ZTb|E4mVMN4$nLah
ehj?ZR`-GgGI>hz%!O(*fV#5Woh+~{xAb$a%P2b!A
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-036.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-036.js
+ Corresponds To: 7.4.2-13-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-036";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("else = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "else = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..94e38acddaa236b635f8020670e675a8e4ec1be7
GIT binary patch
literal 757
zc${5PQES^U5Y`T3j1k6|5=scggb=c>>$;MML7$S$>(V9Oh`qjqQB?buimA4dl_vQO
zd)Qx|64Po7f$sEu_kFsP#?$yFA<OH<Xg(h;e()R%#ntZWx78m^4~L%|Wwfm%)-^AS
z^BGqtnMjo6#meB_F)wnB7){@hiDC*LHPO3elCyh(A2Ab5GF8g{|B$ZlOqdWx9%^qU
zcLo@abXXO8$CSwxDs!tl7G?HpU<!<?r$Lko^Fv9Jl@+!oOl1!f!PYf~&$MpnK)QGF
zT8OiK^E{j5<Nd$y(2j9qPBh6RuT(dcyMyD)z{@0EOyldsJnSDB+D}Zv8>+Qyp#t1y
zSna3wl4z1nzs3}|6=up!r|B#L^lqa?qG5PVzcJlnPCqd&bkHs#FT5sP1+`*QrC2NX
zCV7813^!8$)MsQl%Cwx7D_@n(r?mubdB()si^~rXI{3tdzt>GzjgHcZ9}d)m#7*db
z!QG~mdEJl8@TJdCljWvZri&;tbA5+y8;D08>f5db<Q0&2&~ga{$8w<8BtD!p355%r
zk`55Phb{2*A`bKkZD{LRX~SicxNy`9T0pdM09rJ#0ouow7j$}-edJrj)w@kkh}YGo
ZAvryDh~piM;TX<|4FPe9rIlwu{sIn3+-U#+
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-037.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-037.js
+ Corresponds To: 7.4.2-14-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-028";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var in;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var in" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..ca8d40f6a1da91d1f7965b8e277e3c10bba6a63f
GIT binary patch
literal 771
zc${5PVQbqk5Y-N2j1k6!5K0I`gkZ9+>$)u;24x?T%<Ix6-iW<^38Sd?H5F5BBP&hv
z8}?K7C#NK|-iF|G_nzL<oiv(6moZsf%!jktaQ;JNm}{Z8=fA9=KiL<z0#&#v6;_of
z^3$o%sJM)^68W;myCacj2B|ecO~#sQyf;K}#g*VU5<g-px#HT8z5lU7F=NKnwl?UD
zxs-L;ADV5M?;LAzP=g6qOVo8M?noBt&y!snBAwy=&EFHzI8~z5?sc@1vK`^Nrh3K_
zmBwtZkJF+=_6V7-_dsjRb$U0Jd{tpLQQLj_H1Hx$=9B0mt{?U{4D1K4;3YMetfX$>
zCdG315MCUPlgZbJ;-<t@yU8S(hTc^;j|~V&zj1SQ#@5RGz-Qzcs-&0}%OEP)lLymx
zs#xc3y)Ci0WgnPUE2N*ekeK<bZ&+M2Ul)h(Yf0RQl*?CV@7{O*k(@jDz@?vHrN_KN
zN1Fs*xR>#p>p`Q^T<IO<f5Gj#P+0|Rk<7!ep7J{!F(4jwsAsztkY_+%L(3r)T+0D=
zNIW<>BoxkUkDLNAvDpG@7IEM$p$FQ6_93w!EnH~yn$Lk4;|3T}&j#prEx+0BS+?J>
hh-;$lwTN#H*&PxbJH(-TV>p5ivEi7w#4^f0kUy@#;mQC2
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-038.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-038.js
+ Corresponds To: 7.4.2-15-n.js
+ ECMA Section: 7.4.2
+
+ Description:
+ The following tokens are ECMAScript keywords and may not be used as
+ identifiers in ECMAScript programs.
+
+ Syntax
+
+ Keyword :: one of
+ break for new var
+ continue function return void
+ delete if this while
+ else in typeof with
+
+ This test verifies that the keyword cannot be used as an identifier.
+ Functioinal tests of the keyword may be found in the section corresponding
+ to the function of the keyword.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+*/
+var SECTION = "lexical-038";
+var VERSION = "JS1_4";
+var TITLE = "Keywords";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("typeof = true;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "typeof = true" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..6b8ce3f2ffb8ec7a6fcc2564d4944f27b8c9af95
GIT binary patch
literal 764
zc${65VQbqk5QeqG7-NJnrkD~!F(H_&>$+^qm(fp2=5;BFH)5|}!YGP;OT|<>$V!v^
zhW&>9*C{cr%P`2N_tiajK5I0IZxXV&o)2fU;ru7hu~1y?ul^WeZ*tuH;wYotT4Gi4
zvbdabg_4OxNnWfPy))uPu9YSyY|KP4g%8>YZ<*w5DeyC9f=Q;d+5KNDWuRe9?i)aR
z%!FvRgQ0${iUToaa)qj?YL7&j{q8jfUbL9X{g|oj{<)o2jN8WdkLFmgO@%bcBwwqG
z!%?2i@L~CK2!Y0<RG915ldN20_enTbKT7spyb)rNr1MF9oiu~}3j_0!NqFPoF2nU<
z0u*;^%#@Qv<8<;Zrn<^TC_9~`(+JSHjpm7#eStfkG4Zzl@sp<sL7y$ND|qcyib<7X
zrR<yJ{oR0mXS$i(4SMQc;x=#()|gcY0sX?bz}!+=ai0(tJ~H7q6RccS)_*sQ%iy`m
zK-0=?5p1Qt0AG>iDARIUt`_M$iki>+0qp>YLoMnWrVZp3kayr)go15Y;MIW(tvaA^
zVLId#h+aSVK=nf`=nz`lHgxO2fPNjA(DuC!5DoS~C!L!BCoRMAx?RIOacyGi)o{*;
bbE%=HBsjN-MUP<U!5J~YCnm9VW(edT4#wW2
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-039.js
@@ -0,0 +1,46 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-039
+ Corresponds To: 7.5-2-n.js
+ ECMA Section: 7.5 Identifiers
+ Description: Identifiers are of unlimited length
+ - can contain letters, a decimal digit, _, or $
+ - the first character cannot be a decimal digit
+ - identifiers are case sensitive
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-039";
+var VERSION = "JS1_4";
+var TITLE = "Identifiers";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var 0abc;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var 0abc" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..0d54691704d4087dcd8581cd53e59c3da6c615c1
GIT binary patch
literal 764
zc${5PVQbqk5Y-N2j1k6|VoC_bgb=c>>(Y{M{gh;0my&oR_WC7^qS&`oOtpioG|6w+
zZ`gmG9MifCgM51L?%lo9cpBZsWO=(7&F7=VPo80}xH{bYF?#*!@$!qK4EGy}Wyy>D
za>f-(CSoOdzHac&nCF>Bnwnli#)>I?(nRl`NzPURKVvGGWJ;6W|FJ^0CrpT@JkZ)q
z9vYxO(!X_HDK?-z7Df7d*iZ?RYgElZT}`1>m>m=2wAkQ9H5pIm__TU!lE$gz8|6=!
zN*^bJZA-KtqOA~}L>`XdtD{zgyEl`*w9uZ84VH1Tm`1m8v)I2dG@qG-4^A9TlIgd|
z!+naIY7-Rq8%!0|Vq2l?WSY!EK<7SO#8qCYm{bXt%ED(Rf}PYa@fBHyGAU-ontowi
zVCD<l^OT8?gW<r_je;w-N^g2m5xn*Z)T1nRxvPr$72TIKc<%;%P2w(~-<h_OSxWcw
zn;n++U3~R0bgMBYtV9Tw$s!CJdq1Gn1>#VHx~63Vc?aYZ_!gmH8wRxMz=g{?pm1SQ
z;sMd8?}MX1V!$<_HEqLb9hh)d2Nv`L&j+G~J<vrbCP2GwINn*;Fx?ZISo$>SDRBZV
Z+988;ix|#P7&_1+CUl8KY+ZQ{<R2Ux-kksd
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-040.js
@@ -0,0 +1,46 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-040.js
+ Corresponds To: 7.5-2.js
+ ECMA Section: 7.5 Identifiers
+ Description: Identifiers are of unlimited length
+ - can contain letters, a decimal digit, _, or $
+ - the first character cannot be a decimal digit
+ - identifiers are case sensitive
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-040";
+var VERSION = "JS1_4";
+var TITLE = "Identifiers";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var 1abc;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var 1abc" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..60a1b5a854c66173308284cdf19221ec324eb4b0
GIT binary patch
literal 787
zc${rf&uiN-6xJTb7$br)#gq_=2_a-%SK5(VFH1bH%SgNtn_j{wiv5;~sdkW+COPiB
zKVtvtl$cgy>>|GR^!<2x8c&kXDOudkN3+>z{*4z{Dz5f7zpVaXaxA`cl<{sYv95Vl
zUQW3}$waCoFIT4DH!xL9;iHyz$Gj{w%lL%4!{pv@I}sDYl)XD9Ia><+fVp6jsY>?$
zZE2c27FGUZIMSL`c}U8bT%j^K19N4}L)}EFu+WZaUahg4$$i9B{_rv}O>@cDs`t!1
z<{Y^f2M*6?__+Lg9qk0SrV5U3kzkt|-TP!C#3Ie+ljJrvi~S8lcw;{?*-GOmn|w*A
z7H@>2xLaeceB9-@K0Y#=WYgHM6_YB%S^>81;(4kS5QbZ+zu^<I0%cZBtCbfH)Puxr
z7?>s0o=yqhvt{lb^bxBu5V+$x6K}7E*A6~0K|eAsuyB+n&^Vfn?yvo4)s3gB=9~LT
z6~4?B>Y!>{!fX1K=`|ILY#ztveLtZc0BKQ+`mSRGc?Dzv?G{j=wgq7Wd>Ax<Lfdjl
z3y400036~FV!;Wa|L-;;8+r|J;j#e^ygT(eKy;iBTGX`x&bzkf^?H_d;@ia0r|X^(
c??Rh~<m}ub*1^^x(1BCp!j*=$R`!AX0a9k){{R30
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-041.js
@@ -0,0 +1,48 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-041.js
+ Corresponds To: 7.5-8-n.js
+ ECMA Section: 7.5 Identifiers
+ Description: Identifiers are of unlimited length
+ - can contain letters, a decimal digit, _, or $
+ - the first character cannot be a decimal digit
+ - identifiers are case sensitive
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-041";
+var VERSION = "ECMA_1";
+var TITLE = "Identifiers";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var @abc;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var @abc" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..c8e9783b89f96c9b37c7ba0aaed4bb2fd7e4c130
GIT binary patch
literal 784
zc${sK-)q}25XZH{7-NhvA(&A@5g~-E>q?vEtxrkjbt#EAV$+u}ifZ3dG1U&T(j<?2
z-e0i)c5<>-W$Z<|U*FH2PNPYDlaR&rd^np8=ihjah2m;=^~>t^CVS^QM;UEb603@r
z#o3fAluRT_@?vS?U1KJSDSXsYI^qSBJCkXRnGnWp>wK;$rcdXVNzU#Ce#A^L$y6!3
z|Aw^C9f>mgF&JvfvZy<yOfFFwPS2!XwM*r0%vAR9GGIrSp;Vafc}Z5T&`UDOSIWJM
z*FuE*^08p+3Qubl&t~{||9T%sF>Z`UpMiSlJ#LYt^GST2n8p5v0lc@LnDmoqoKC*P
z4cun9s-NX)%33H7w=2w)n@-Yc1V}ehulzHz9A#Qg%Oz0%Hkv23v{Fo}6e|^|^6(?w
zxTG&YsvcyyDFWKl25u<43(bzIpcal<h2B@D$Ig8{6uszQ27m7>?-Sz!b4Teq2cMV-
z1#Wr9#E0`i-@QpL?goo=9!2JHKjEkY#P=+(X}b=PH$WC}<bwyEYr*-!XhQ#Bct9<O
zgh2EegkTe!5DOZ_`+xKxa^U1(*w0`WI$`h@h;G*aEjqISddIFGv^tj6Y&gW#r|nSU
c>msX7+9wXNYOGD53oT;9F>#5bm8U@d0F?RO4*&oF
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-042.js
@@ -0,0 +1,49 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-042.js
+ Corresponds To: 7.5-9-n.js
+ ECMA Section: 7.5 Identifiers
+ Description: Identifiers are of unlimited length
+ - can contain letters, a decimal digit, _, or $
+ - the first character cannot be a decimal digit
+ - identifiers are case sensitive
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "lexical-042";
+var VERSION = "JS1_4";
+var TITLE = "Identifiers";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("var 123;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "var 123" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..2a0522315dfb679b3818a26d3feccb6804a477aa
GIT binary patch
literal 936
zc${5Q@k`r46uuoHgd>Ddq(~7tN-5PksiU}|c1&w^70pHy{9!WWnm+5{HCHZI+cNgI
z>@V5>wo6luEP=;&?|tw4-aYQDA6$j#?s9N?b8|ZQ$w!cAu9wGut;YT}*PxgPwc^RR
zx0otOQ!bN6e?@xWpo%0t;|WvCB2hJok?AYQwOgh*8wxmwSTM!3RQ3N;rm<dVgqmrX
znEtIU6QanIGa=)r_Nh6HldK*wH3nT+HHy-ki6XV^G95p@%2GoErD0^o2xB>gN&xdW
zHuu3yh}sKjWxAs6WePmLfywag4qEGl1+xh#9v6l3%C;-mECn}=6`$(6FdFoO%dpt^
z()xm%_A^sn*y~39Z-EPoDa6_}A~T^&u!v!rEr>+@=(^{{a+Vl74Bl;T5N7=E%uG76
zeiKJSs!I=2Q6c3tt!1b|*A28oTg3WB$W?f7-!7$^DIFPpJ&^R(gX%{m=ZQ}n2Ed$_
z1uS^X#QRqJ<9R+1ZFXq&h|;mtR7=W}1aiOXF>&CT2}~<5mM0y0K->$)1&n+x^B1+b
zt~Q%=hu|GQ8=}inxDY%6I#j@(Qab1QktdYV><&;ox4AOA{t9daDw5Z7d>0LRy<(Yv
zaD5Xa-?QA3M{Eb9cNooanP3+?wuKrwC?T2y7gbyjS1~g2a~WI6LMH5EH!nNrLk<Y4
z<-kT8Wq%tZBmBc6xMEUX6|FxbvbVny$$zwkTIdjMqg_<4*}lJ3v)ql6gKZOuN3q{F
Z#ua?D>tJi$af0fYpikJwj!`pL`3LPs4*>uG
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-047.js
@@ -0,0 +1,50 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-047.js
+ Corresponds To: 7.8.1-7-n.js
+ ECMA Section: 7.8.1
+ Description:
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-047";
+var VERSION = "JS1_4";
+var TITLE = "for loops";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var counter = 0;
+ eval("for ( counter = 0\n"
+ + "counter <= 1\n"
+ + "counter++ )\n"
+ + "{\n"
+ + "result += \": got to inner loop\";\n"
+ + "}\n");
+
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "line breaks within a for expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..ce2addbe716a42a146c4534ad50218fddd6350e0
GIT binary patch
literal 943
zc${5Qe@ojy7``1Lgb+d~QlyBylv1j7Qb!qM&Od5bT}9()g8#^nGkt9jueox$*vh`l
zzQI1hzS}O1nz00q_viCG_avv|@FF6&=aa$J)nM|2PchY8KOg_GI-T(*dElr<>!rdh
z<1#(G<Qf$dkybpNRrTg6Pp76*?X+*0;_P1FS4;#`Oq;3J|23)F6-K0)#)a7j1IE;I
z)!7*`A*$3p6*7733`{ahi-oGyuZl5KGt`x!W~`ovOega<o|YL#rE$8!ixRm+FG>_&
zYWFV8h3LIpHp~~Ocv7)6LR?i@eS<m_EYA>LA<a!UfCmK|Pp)ur|F4g?Q9K!k=TYVO
zZ|kG|#1!rN(P$WtuS3s_=0bb8USgtaxK40cnCQmi_;N(izZp#;Gv_BVPmRtX#!L@c
zhIH@OgH+Igmj;|b@7R4!zMR0(Ytrq)9{hAmBIuq#^E1q(2A*a{7ZfN$%4Kt}9ZGl;
z0D7+EDm@cCMYvbU9y3^RJ?AN~%??&y>LNP2>pS?wM4)B)(@^lfGvm^<E^y5gCf@h@
zpK6(AN*6cq&KMUsg_Sbqe?vA!70XLGbF^v3@f=~23(P=1z#!LhQMd~cE_fn^(Kb#C
z{|$8j9itOha2roXqsr$MZL}x}e9H@Ju47a3j*@Fyw~0p`%c7k!2<UDZc=UtolYL6e
zd03~Od5J|^#4Fo2Jtza0Hp;-E?Rv0Hi2?p#*`#4gwO#V^7!a^2-ELZbu+y^K+Llcm
gbGm+;_)S9sWNY6cmbW3IJG4(+S|<*%&1R31zx3@H=l}o!
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-048.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-048.js
+ Corresponds To: 7.8.1-1.js
+ ECMA Section: 7.8.1 Rules of Automatic Semicolon Insertion
+ Description:
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-048";
+var VERSION = "JS1_4";
+var TITLE = "The Rules of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var counter = 0;
+ eval( "for ( counter = 0;\ncounter <= 1\ncounter++ ) {\nresult += \": got inside for loop\")");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "line breaks within a for expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..6a50c980bd9f93349674282964ed55550b9dbd72
GIT binary patch
literal 971
zc${5Q?P}XF6xD<YMi^s42_=LgLI`Qom2`x%^<yl}(k`X-Mr`_HWfax9O+*zd$a0f1
z_AGmnu~(ZMr*)YP^5yE>bIv{Zbm(6M=;nOXySnO)e(*8Gn(L>dKUQn+l50>*1X}TU
zGFZ+PBng*sYq$d4b5KQ-p7NNfr=n3ejj@?4z|Cu>IJ*<@86v?H(+1Tn1_I4A%nZ2k
zKTfJzp9xVwyFK%n#2GkbY67|tA*Vt{53K_5%A#q4(l9psK_us}n@RHM3TAh&SE>52
zc(q5Up88Bj(-(i_)=!0Sf=KbX?yN)d(-|lp6?2u<P+zb#fyT4)%G^r(CJ0AE|2!xX
z|7(51?b0Jt4lL&oX~z(yLc77B9}d6zWmrZq&oU$7FuWYN*Mm`D`feoC*jT_2hEt%U
zR6s)IJ?*7h&a(Ar05cv*VFDP&nT^bxfF+NZc-!fIILmct`-IjH=|pPE<HWe4_fk<I
z<-C4G=t7w_zW^J93gxAo;B7C2ME99lF2l9x+6FzL9fGN?%`LeI_HVm3JTh@6cntJT
z0eeX3g6k=dDO)MPOJdF$;{wLkPqMitYq#k(v3`-JFX_wrR8N&$#LhQnLLGZr=Kp6o
z(M;*gRPEWy@d@2OA|7p-30TmZa5NYcdH=?=f|2Lij_VPtgwY#}7Pw+#2RkJjtqT`5
z^TI(J#KnggnX_8K7P1hwQ5`$^bqVd}1wq}su+TxR+{DNbf46L0H7&1>){h}+?X5`i
z7g2PKI%p4VqIZo_xxCe|$c9(K*-6|@Tz+qat9Wb2#`bz*2Yti@)v$$2hOL3oKbLJB
Ah5!Hn
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-049.js
@@ -0,0 +1,49 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-049
+ Corresponds To: 7.8.1-1.js
+ ECMA Section: 7.8.1 Rules of Automatic Semicolon Insertioin
+ Description:
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+var SECTION = "lexical-049";
+var VERSION = "JS1_4";
+var TITLE = "The Rules of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var counter = 0;
+ eval("for ( counter = 0\n"
+ + "counter <= 1;\n"
+ + "counter++ )\n"
+ + "{\n"
+ + "result += \": got inside for loop\";\n"
+ + "}\n");
+
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "line breaks within a for expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..7e1038994f23c9b5f3efacb95bfeee4c18a53448
GIT binary patch
literal 785
zc${5QVQbqk5Y-N2j4{TT5=sa~gb=c>>(Z|Kv`<Oqbt#EAY_DI!D5`T!#T47fN|P}5
z3--hIw<gD|9>XB+PVc>Yck*}|-o#{a9gXJmQS^;3F;iUa-~TfDgXtl8;3$J#A+aoZ
zo}JIQLdis|B+ph&z2AhfVhY!q+8y(3sZoti|CUM4?gf6pR4~buhWGxj<+3wjLNtO@
z>oB=*3iep!>G!LVPF7jfDPeMjs_8Rmt{PTP7f~u)9@uf37iiyw8zIgr$2^_m`u^Wh
zTN9?z$BAH@61$1qAJXUH+97TmtP`h_7mEIEp=UZYSj0&*4X@*7vA^Ncd}0z_xp6Q_
zrk_JcOKgPlahGCIEyTfHfvK{SX)+7k+aQWH%Kt$x=q3G0-vUO#j;#xUCCwk`XruCV
zWuL~l=4meUzNT5_LQ4Vl5-in(mFRqAT;S6A!nDPueG^~YU3qk%9wlz6r8LS@dHt#_
zfjgcu@p|}f*bj61?2Kx3zRmnnF{vtH3!j*Pmvk%jU-1dq5@nLl^3@`Vf}olCD|CB6
zT*q)+%Qk_$0P+S}7IDBf4d~Z_3nz8pz>(pQQy}^rw!qaNF`z}9`r3qc9au1^0~<Og
zUJHm8_Cb@*OaQNA`rdKRFphka*!r}bHu1F!gOcM@ix}=f7(AfFf^%XMQ!~3j{s6sN
B=1u?r
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-050.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-050.js
+ Corresponds to: 7.8.2-1-n.js
+ ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion
+ Description: compare some specific examples of the automatic
+ insertion rules in the EMCA specification.
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-050";
+var VERSION = "JS1_4";
+var TITLE = "Examples of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("{ 1 2 } 3");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "{ 1 2 } 3" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..4c64bc2295244da32fab93e84318c32fc5324cec
GIT binary patch
literal 832
zc${65ZEM>w5XZH{7-NhHp_o!a5g`ld!@9O)Zx;3<$-FKl$wuszK^R4GE~%Je8ChwP
z&#*5&C1!OQhV$v}f4|cm>J7&C5t-gix}#Bd@{7+g)m-m7f2?L}a5yYDs&Jbr%yTZ&
zt0C8@n25CE>9UMBOE=O?<I0rQdpw;RRmo{SFvZzS;Acz(Q%oCq<NugcwLTM~1X9Cc
zYF7r@UGrO}`yMe<OVnitw<l!syHyIxs(P$;eWsJAmkXYZaZ~0m_i>(#a5Z~9al^1s
zX`CO(Q6e++qD1jb(|;K=!66<T@O{D7Il7PIwGh)No(#r!QMuT+R@;7N3NHL8?8k#|
zV-L3(Cc28-1hf4@JkxkBv>OlNVdy`ElgOw5-TUa~vHf!)6>YH&ow;YU5YmfJwEmGU
zrKVa^o~Ed%kTR=xf>+{du9?y?=GxK5G{=&@bfo%8$xRvv-13Bpch?_ofO_AV8E;;p
zEtAC!g|kVxWvfhJPUV7j*IKUj`=Sx9cp`<t4AT8R46veQ@jx7WX2SczxWGBxDD!r{
zBAcU%<xnmw``h$cj?;J&hUJQWz$pdddzR-rwhQD9koOQc!~@s1;Iwdjs1}X~Ez2Xv
zK#aW(z&9VUfD*4ryKq%F4%7<AhI&w~0Wshzn4(J?;HYj_s*Q$a9aUUn8|!!{q;hUZ
Z$K>|hA(nptLjVopK$F<SHI*ko{sL~e^nw5Y
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-051.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-051.js
+ Corresponds to: 7.8.2-3-n.js
+ ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion
+ Description: compare some specific examples of the automatic
+ insertion rules in the EMCA specification.
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-051";
+var VERSION = "JS1_4";
+var TITLE = "Examples of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("for (a; b\n) result += \": got to inner loop\";")
+ } catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "for (a; b\n)" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..a5ea1626c2d4e4c750cde5a4cc8890f8cbdc8eca
GIT binary patch
literal 915
zc${5QQES^U5LORkj4_@GA%s$jC?RBBR=UuQ!Jd-L?NXYo#HKH06xF__qOuiarAZ$4
zbM_neIyt6w83J*-`|i8%?lhXrE+cY#F&|E+!}%|sVy?N~e*0_ndz0PcfujmHONB+j
zWqxwSH7X_|t$4nu{YN97r^Zv~bn9TGna0cnIyX#lb}#TdCW0xZrRx6gGWdfr6QWM1
zhMTEv?QrjAD<RyGkjYbTXk3fDWUm2dwKHaFfx4DOO$e37)YOd<xy0`IDo@I)Zv^y9
z#XOl}cK^2d{TZ&`v>dDLnCay4wY~le_qE~4&<tu<p|wMe1zQzJ&!x(kcm)*gm+~W-
zZoMc`e5r4vcs`k3MD;q}SzqmErr?8zn<XaNkHT?0`8jLgCc$Ny?ip1pq1|{AUxiRK
zr`s1|K>sG3M<u$@Oz9X44e#gShGk2E1(gqUxY9B!JEjq4Jdwf-eUg{GRLpv%@<C#j
zVm3^xCoT7_j1;jAO2#oOusf6VRS?yWO0IK9n;=~)^KE`0OHsx0N-kOgH{1|@JpDWf
zXwN`#O}%r*1*YCLGh<BM%jnbHS)gV0)f{|g0_bf#55sycf8e-nLEw9~*K{lw$R3d2
z&~}Ljj%7oyGMaE&86NE09%%tFcee$;ImCu9#H+$C^ee-Gqsp-0gf;>n3_bwTu^Nq_
zW7*A?OUm2v4oG8QC=Lldc8Klo7~v3(i34q75!d8(fb0`;1jLAI1F_1Qdsff|67)*S
Os*n!{276`$@&5t#+YJo>
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-052.js
@@ -0,0 +1,47 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-052.js
+ Corresponds to: 7.8.2-4-n.js
+ ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion
+ Description: compare some specific examples of the automatic
+ insertion rules in the EMCA specification.
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-052";
+var VERSION = "JS1_4";
+var TITLE = "Examples of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ MyFunction();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "calling return indirectly" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyFunction() {
+ var s = "return";
+ eval(s);
+}
new file mode 100644
index 0000000000000000000000000000000000000000..1d79ef9ac392f553f6284359ed33fb5772037490
GIT binary patch
literal 894
zc${5Qe{0(?5LFLjj4>vJVoE7Rgb>mnD_z%(v9Uptd0k4Ijo5U5lu;Dtl8Px-kd-F+
zaQkjMCtE#+K{~y=d-wdLZhvr{u=}fF=k~TU{2|AfTWQzte>v@Te{+~fH1TR~uqdR?
z&u*keBUECI%%>IJs=~wyi!*9%bY(uKs*0y|CyW#$g`Y4}!U#*{&HpiN4theVijWhJ
zFzX7q?9evN%NeOKQ?%8Dc9p8?{jSp4&+|XhyILz0d6kZO!e);>B^Ct+NoM5SHd3?R
zpwB<!KMWR1aiT|KaZI9<OwY0T7uby0K&NGo%x-Zu`q#Pr0WPc4eUc9QgR7)+{JZnk
zeG&#v0xDT38{le=nXTh0!+B{`n8dxb|8?M}{q!ad@8V%XCqOs?4kA*xl9^C1&R@T}
zpk0yi+@M{UoR`;Nh)b=5Z-VrWVbmIE{>;qnqtVN}#@iI&lGh6>j7_ny6FK2+!9ViR
zk&miCzSYK0KJdmnKGl|6;wclw^R4rxA)~*b7^6w`jh=e=B$R)hynMLyERhDEg;Y4M
zS-pKl!+0fTbA<)h6W&=^JuCg=3C?7u70K)8rN<<+R%+^r0`Jpd99Q1WV4njE13w5o
z*8#Qz><S`}1>n0r>}`V(PPah-mrlT%z-Vnp5Yoqd*k!>s?ZEjq@PKav7Y+_~8^DP8
z*mdf)DB7X*Fe(X-U4Yh}TiZQsIs`hbEbxLRt6k857JGB-F+bc4fqiH&59-Wi4t1UZ
F`wial3hV#?
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-053.js
@@ -0,0 +1,45 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-053.js
+ Corresponds to: 7.8.2-7-n.js
+ ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion
+ Description: compare some specific examples of the automatic
+ insertion rules in the EMCA specification.
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-053";
+var VERSION = "JS1_4";
+var TITLE = "Examples of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ a = true
+ b = false
+
+ eval('if (a > b)\nelse result += ": got to else statement"');
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "calling return indirectly" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..4ed1a89e9de13a8eede3c0439c0553b59010dd49
GIT binary patch
literal 882
zc${5QZED*<5Zw+!2qBCyL4**(VvKRpG^E8TrKN3bS4|xfwOAs5LJ4bW;w)WDX0?v(
zUZkh#nc5?C{E;YBE0%flX5M_T-F|o;vFo!z=kl^M_%2h-j5LdPzpYlQzXG=sbugc3
zEDD)tM;Fqd7Ai7YW~0*IEX~LWgJVjqcV(7RRH@Ur5?YF(!cUkep@qqHyF*E%Y#AR5
zJwj7Pw@T_sq5mbw$ElFei!x}pCzLAT@uul;Iz}y%l5o2!Pk!u#I4gaAPnhJcr^K|t
z!{sb8xy14C=@RO(UaX=XM{Q86s12qo!6?Zm=-z}=rT7CuZLi#3lxR6I*HJv^hi6f_
z@jvj^z84yvdsJnrjED0HCZ>k-1SiWWD^bvk`(Hyh?#CAa;DNm5Ex|wV;l7KiK%VgT
zJgr;>gNUN|Ow-U`P^75i{30JYcrTQD9=*J2I|d8meG}AL+6;64Sc027ozF5DLIS+X
zTLf{&A+5%g&=UoM7zA@Mo+vDMe#<*klaH4h;t`Hzk}HzvXUl;}%=;{)!W8yvg%R2;
zC8{Q0KOA4-TqZ)jI6i4#$Achv^75eB09Nr_ujbemuxG%2fnQ-BIJOIK)<zAs*M<j2
zR*kiR(Y@tEl@4>E!MrtX!SUK~U~g^Mu)F7TU?lw0wLJH5i)}svd;|V|Bv5}~P6@O&
yz&WKtz70^_u`7PPVG(CBn{KDJ%POy_k!^Nx;4rtkYKHzMbKn)TnMIj9!2SVryZWgB
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/lexical-054.js
@@ -0,0 +1,46 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: lexical-054.js
+ Corresponds to: 7.8.2-7-n.js
+ ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion
+ Description: compare some specific examples of the automatic
+ insertion rules in the EMCA specification.
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "lexical-054";
+var VERSION = "JS1_4";
+var TITLE = "Examples of Automatic Semicolon Insertion";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ a=0;
+ b=1;
+ c=2;
+ d=3;
+ eval("if (a > b)\nelse c = d");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "if (a > b)\nelse c = d" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..6a11edd558accdc27b27ec717f7a0edb3ad78384
GIT binary patch
literal 929
zc${@o(Q4a35Ihzkj5vf4#uyXAVT_T}G$bVyLnt(M)zraOiY4+AO1Q`yN3Eh0r*j>D
zP2c<8|Le&jR!Av=)86dt%xKYQ5?qGl=3;(6o1M?UB@4_{qBdv0jJ`M7UhWf={!=co
zC=!t!O%sKZr=gNbwyg1fU51J)eAJ`eQIah*tJdjXbD8kF6hC2{a><pZ_g-T{?u~hx
z)`H%-el4?7vIY-Jn<Sp$<K4@AOnY*<se#jaIO1}Ns!r1ha9tCvQ7Yme)@`s#QyRuH
z$yGO!n=x1M!|s!qRzs<9p+kqU$Z_~G#%rtAc6glfRe?8QG@k?)VZGu%#?bu9CDs0`
zRKXjHPdUcQQKDL|9s1*FauvAv6k}elii*4MnqftgXzJV7{yfxeKpLz{ck41dxjp^p
zKeG#VFC?paN6(_(00s{8)Puw|YbY!fz1oV>&pb(S(GLXM`7uos>&%HXZOjXF3&o`>
zZ)`2~fA9tQ0%atoVmW*^%B4_3ZE}2JNxyQvw#Dx%KKsBjZC=@WgELmaJHGD!SL+|L
zH)v*C^4sI%6L&Xo6U}|UUUdO`42VrF$E79!AwXu(Y7h#RX~Ah#xX`W&2Ra5N2SD_B
zXoG7I3y!K5K(8t&^sB;z<NbDLWEytUZjr7Yvb)4?I1XvOZ)gyxqpv`EX0zSt86`qW
eGSzrf<3@{k2MuDmM)|-y*w?aq#3Z2Ib?CqUj~UJY
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/number-001.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: number-001
+ Corresponds To: 15.7.4.2-2-n.js
+ ECMA Section: 15.7.4.2.2 Number.prototype.toString()
+ Description:
+ If the radix is the number 10 or not supplied, then this number value is
+ given as an argument to the ToString operator; the resulting string value
+ is returned.
+
+ If the radix is supplied and is an integer from 2 to 36, but not 10, the
+ result is a string, the choice of which is implementation dependent.
+
+ The toString function is not generic; it generates a runtime error if its
+ this value is not a Number object. Therefore it cannot be transferred to
+ other kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 16 september 1997
+*/
+var SECTION = "number-001";
+var VERSION = "JS1_4";
+var TITLE = "Exceptions for Number.toString()";
+
+startTest();
+writeHeaderToLog( SECTION + " Number.prototype.toString()");
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ object= new Object();
+ object.toString = Number.prototype.toString;
+ result = object.toString();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "object = new Object(); object.toString = Number.prototype.toString; object.toString()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..ee433752a39a88818dac3508a3a6d7d5dd5a8d56
GIT binary patch
literal 932
zc${@oVQbqk5EX|B#t36f2qlzaLI_URg|3uRRyIg7uS;p%5u1J~qo~d$_2ybeR+{A3
z?92Ye{@mo4#Gx<*;_ltO_fCffBmX8K57(3ac-)`-h^Ls!Sgx;rYaMsANoFw$Z<Ptm
z^O&c-+gPGtNgzd>&MUlAg@I%eUlg@9h|{U+s&v}-OvLOd!7mskOfbns=PjfZ+`bZ;
zr-eo(dpKlCQl;lrPsqd^W#w{GOb|z7e0ka*-BIH(v918)(O)D<)5ql=Hb{8%>vCV=
zt&yVu6cVRu@*v_FwnDKUG8sMZUQUBZ#F=bt&|$(BIX(p8WaM85)r$XWA8W5nQ02Tx
zB*j&Rk%V_<;0?pkop0kR!mL;a<xf9V$&$R>x)F}TTMy8@_a=ergsv50E{7~fI}==T
zxz6xUNpe0pDK4G6P2zU1oD%N6vSfjGGgbB%#Upz=;<og*)$Qt1xtLq#QmCKs4cQb$
z$Zz@Fa$NZ=lou_{F8-_RcI{j;A&a5uR~9EYHEx0rkLUC|Q>&fU(+%<c>FF6QH99_b
zcI$AI4PU08y)BSCGcLAnJCBEO;(67!b7&m_F{y6V4Gn-0AY*74go0kv;j9em&?^HA
zE;W-J15tO&gnEtW;FcwTlQJ;iq6{=Rb()PqO`{e)ARR@bhlHB8P0pK+0>QLZ3Zz}L
ln~k<sAf&hrh1&|(4#>f=PV{=MIB*DUVnBmv1eCiP`X9~B8ZiI>
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/number-002.js
@@ -0,0 +1,48 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: number-002.js
+ Corresponds To: ecma/Number/15.7.4.3-2-n.js
+ ECMA Section: 15.7.4.3.1 Number.prototype.valueOf()
+ Description:
+ Returns this number value.
+
+ The valueOf function is not generic; it generates a runtime error if its
+ this value is not a Number object. Therefore it cannot be transferred to
+ other kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 16 september 1997
+*/
+var SECTION = "number-002";
+var VERSION = "JS1_4";
+var TITLE = "Exceptions for Number.valueOf()";
+
+startTest();
+writeHeaderToLog( SECTION + " Number.prototype.valueOf()");
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ object= new Object();
+ object.toString = Number.prototype.valueOf;
+ result = object.toString();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "object = new Object(); object.valueOf = Number.prototype.valueOf; object.valueOf()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..3733ea0fe23725f32eace83b5ee538a10c96f1b2
GIT binary patch
literal 945
zc${@oVN2Uk6n$Jm2qA<JN|7S+D5X^AirYkF8$#PfSE=b}GQWt(Grg_ZVqSQ8we9D9
z+n?C4+5g&$u||XuNX|WZ=bm$K(jWTg0l7Mx^e!%Xlk0ejsf^|N(;uzf89o-X7=^dW
z1m=0n)9xsiC|D9m5vTKtZ&xsoOya$gHv4fpRi~;xot`=|Pm7l?q?b&@>^8wK7$r<F
zskqi_j*IO9OOi@;ShWh7n4_#*_KO5@bb<G`FQZcxhlzDXG<;lEmDx{t^wYfY7fC`@
za}*M%Dn=0T46Ps%aVDFgSPz(t?w)6?KbC`pEpj}5>H9j~RS-^w{#j71_^)=NKQLh_
z|3xC<jf<-YvtoJ+R~bgq4!l7)9Q)R|f3A@Iz>)=yXZEEx2^8&I_D0{moAId`4#SZL
zXh_WE@6uSUo%)L+NH-H)a=Fg1`_zE4oXR_-o02PrmLHVz+aJoAn&-j0o5K@tlPIS%
zE;bFHbe&zg6zXsIifoD^<Rd<}zA?49sddWY1gGw^GwfQW))}U=I91cv(#QJk!NCVd
z^3vQYA8sz0kfEBzp&fZAa7mB;J4<J`?Q{CPIW?Ey%hV~<1D4}eIPtt{<-cHO8;EV0
zHAgo92mx{pb(2_N=_Yhb;J|hXYOtf(<PeCuQyXd;G2ys;1<)#i4j)TkK$C7YCWdA>
zuIrM$wyls=C-2qSea&bQ%O<X(z;+b`($wo)jh0q0q!8(fuOBF{I{Cb35VNKg7c}6A
N=+Ges0hMA4$Uk2~9Gw6F
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/number-003.js
@@ -0,0 +1,50 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: number-003.js
+ Corresponds To: 15.7.4.3-3.js
+ ECMA Section: 15.7.4.3.1 Number.prototype.valueOf()
+ Description:
+ Returns this number value.
+
+ The valueOf function is not generic; it generates a runtime error if its
+ this value is not a Number object. Therefore it cannot be transferred to
+ other kinds of objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 16 september 1997
+*/
+var SECTION = "number-003";
+var VERSION = "JS1_4";
+var TITLE = "Exceptions for Number.valueOf()";
+
+startTest();
+writeHeaderToLog( SECTION + " Number.prototype.valueOf()");
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ VALUE_OF = Number.prototype.valueOf;
+ OBJECT = new String("Infinity");
+ OBJECT.valueOf = VALUE_OF;
+ result = OBJECT.valueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "Assigning Number.prototype.valueOf as the valueOf of a String object " +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..2457b923fb958288560114bad858ffc7b4598c31
GIT binary patch
literal 779
zc${5QVQbqk5Y-N2j1k6|VoC``gb>oM%hJ(r`;>TImyviQ_WC7^qB_?^n`;MIX%a?%
z!G6;I+!UMEV;GKm_w?S~Ngj=(&oP-_&xX_KaQ0m+FjqqD-~Tqcy>SKZ1<G)@mROde
z$omtaQ1UERQsm2~-X4j3p(~B1+mNy13LiAlx#3dqy9_^InsLchA-n&V^m(SuxZF1e
zt$=4)1MN{(q(85Q8Z7gJZ^GpgRnxoIP>qVlsT6C)G>1~*LN|`nVvT;lRk{i?zA5n}
z!fm6tI1Db*DL&l&dk5`A?kmm9UiNLY$+FI~b2VP&J&%*wIJ%CTi~R#v<|CKznrgRA
zrYP>#m?{r<DXtI8J8>8!<1dk&jFU;|+=R1OBfxG{u$Mzjtz@yyEqvq|{mOOUMLSs`
zyDuawpQrK<s3*?YFZ;=5JuSg4^E540f~9f~A>bv#8U4sbh6_vS3Jrtl@b=PGMg7K&
z-<!eUvj3xGTdDtnPskT2lVVaVfqA-9)#z!S%)+qQ_8a)eKpbjQ$1)8duYkM--zF3+
z!-k7GaiCWx6pl@YoC49Y?*r8zv0*@HO&idu6AQdLF~MhU2Z%QIK#Pt{fRhu$b=w`o
kJn{@;>S#Hq#68!hEyB(%V$;eP-a(64&?Y7^w6Y82FFoJm!2kdN
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-001.js
@@ -0,0 +1,47 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-001.js
+ Corresponds To: 12.6.2-9-n.js
+ ECMA Section: 12.6.2 The for Statement
+
+ 1. first expression is not present.
+ 2. second expression is not present
+ 3. third expression is not present
+
+
+ Author: christine@netscape.com
+ Date: 15 september 1997
+*/
+
+var SECTION = "statement-001.js";
+// var SECTION = "12.6.2-9-n";
+var VERSION = "ECMA_1";
+var TITLE = "The for statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("for (i) {\n}");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "for(i) {}" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..cc99468f9b6ffd887290667e4214d97ed6627ad1
GIT binary patch
literal 837
zc${5Q@oU;Z6uvz|2qA<ZB1NPeB4VwxuJ~KoK%MI>nhlfn7wO71zUr}<gv(i#vA<yd
z^v;BuG6I)(-+SNpzW2D{#J%&#;&wim%?9%azQjm!dARwjHCvPH^2||;_ldwX<#E)V
za*2Y4o)kP<6?lEfqoqO$PP0gQl1bdCMB|<b&YnX2j6ui*ld)+252^avh=pN6r%IcN
zLjm*$>bHuHiarx7lttH8kt*uVVHgL$EH4l|kquRWLgF$5y&z7|d~~;A*g4wd!3;M~
zZzrydm<-mVkZn_>uUut1V^&?<y;*`U4q5eS;DzVUC+@9REcQz4>n}{eWeN8ICdY9t
zMc;<f_QoTB^3AnypI{(Of8tNa_WgM7DG-qEgj)SqWJ?r&JdIbMHnBh|*DRuOgmjbn
zrg(DW_?XHOOR<{1+IipWUH_!dv7jxgOi<pT3FVOz;pqkaO>-mk@?(Z9l7}1m$Du8`
z7PzAZzOc~x!gz?wl9Cki*Z?l9?@VoF+4k3Xl<szw;Hje_RgHP)eR%9Q-I$(cRt-eF
zi-0;Z&fn6)pO44Io_;`u0<kT_vNcl&@(#!qR7_%lp&4+N2R3x_z=D=;kvb4{mMUPY
zj~LJ+R-V>@=79#?JTRfzD4zjQ!X;3oa~+_1t~upuL(@x+PE2)bR*g8<O0-TYZG#wg
SCJbe$5e*u|B)Vd@f&2qOg7_)`
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-002.js
@@ -0,0 +1,69 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-002.js
+ Corresponds To: 12.6.3-1.js
+ ECMA Section: 12.6.3 The for...in Statement
+ Description:
+ The production IterationStatement : for ( LeftHandSideExpression in Expression )
+ Statement is evaluated as follows:
+
+ 1. Evaluate the Expression.
+ 2. Call GetValue(Result(1)).
+ 3. Call ToObject(Result(2)).
+ 4. Let C be "normal completion".
+ 5. Get the name of the next property of Result(3) that doesn't have the
+ DontEnum attribute. If there is no such property, go to step 14.
+ 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly).
+ 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ):
+ 1. If Type(V) is not Reference, generate a runtime error.
+ 2. Call GetBase(V).
+ 3. If Result(2) is null, go to step 6.
+ 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V)
+ for the property name and W for the value.
+ 5. Return.
+ 6. Call the [[Put]] method for the global object, passing
+ GetPropertyName(V) for the property name and W for the value.
+ 7. Return.
+ 8. Evaluate Statement.
+ 9. If Result(8) is a value completion, change C to be "normal completion
+ after value V" where V is the value carried by Result(8).
+ 10. If Result(8) is a break completion, go to step 14.
+ 11. If Result(8) is a continue completion, go to step 5.
+ 12. If Result(8) is a return completion, return Result(8).
+ 13. Go to step 5.
+ 14. Return C.
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "statement-002";
+var VERSION = "JS1_4";
+var TITLE = "The for..in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval(" for ( var i, p in this) { result += this[p]; }");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "more than one member expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..004b0ccfe7ad3ce7b25b2012dbb17e521f72608a
GIT binary patch
literal 1105
zc${sLe{0%67{_l%2q9z=LJ^Tt4iT}o71v2AZ8ut-?JPAdChU)uQqJV5W{Zhj&RQ9J
zoqGX$BYQN}NLd2O^Ye4}eD7La``RJ*SN)4#@1p+@_z=lJ&QJfSN7e4qc?v*uUM2#P
zB#5K>O&~$=(2*jDhFQGS3L+mPSx+TPI+9BmW1{?xi+~S8_yS(Y1(&g?ybWPJLl_tH
z46xniVVJqq3;YeE1u+ZikM=YS8?XDbr(+O-w}Eg+L6W&e8)h55tuXd}HZ!ct#SmmR
zOvx4VHkaOLJxYG*wnIKmV1E$}ydI1Pn_88T2SS3sq&r?bf#c1}x67Ti<MCvQ_5V*7
zE~k;Vkf#;<bGBlmd`mLBjK!FTcPQZ)P=chgD&G*+a6A!A<W3*tRAk3;@3{T0edT1w
z-&Q`W&s@+w1813r(t;NcCQAgoOu&;lr_*-3x3=zf-J6cto8Jz8EW+P9eFwu7Xskc;
za0->DSg<OSs6GoK7VolOdc}^}8i*+o&mt?4Tu2uZc{1QW3*ku~jCka;1UH4%D^Zo-
zx&}x#Wt`qY<Bp>gz9zBNWL2cWj1`mBYzK|TN6P4~e(ijCY#Nt52*GDFf!E|Ka36#l
z-^4?6v2dFwP;*DXaLe^NZgvf+q$;qzPs>5>Cl9Ckz1#0}GR592hx-c6nK|7sRc%Y5
z<Q*k{X+b9j)fAoXr-n%nQ^TMqYL0AEg5RS&HSi@mtrH_nE3}y!DlMjlMk_nTG9?K9
zuIj|X&{l!uu!|HI4O`^(L0~Bb(gHoBj44*pDl4kFtq={rYOX{q1gQmbT+@hdq_sP=
rMpW7$8c~o?rKCZKWhuEjC030RTUE_UKEGP!Ts5m}hrAl*c{BeH2nRw=
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-003.js
@@ -0,0 +1,80 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-003
+ Corresponds To: 12.6.3-7-n.js
+ ECMA Section: 12.6.3 The for...in Statement
+ Description:
+ The production IterationStatement : for ( LeftHandSideExpression in Expression )
+ Statement is evaluated as follows:
+
+ 1. Evaluate the Expression.
+ 2. Call GetValue(Result(1)).
+ 3. Call ToObject(Result(2)).
+ 4. Let C be "normal completion".
+ 5. Get the name of the next property of Result(3) that doesn't have the
+ DontEnum attribute. If there is no such property, go to step 14.
+ 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly).
+ 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ):
+ 1. If Type(V) is not Reference, generate a runtime error.
+ 2. Call GetBase(V).
+ 3. If Result(2) is null, go to step 6.
+ 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V)
+ for the property name and W for the value.
+ 5. Return.
+ 6. Call the [[Put]] method for the global object, passing
+ GetPropertyName(V) for the property name and W for the value.
+ 7. Return.
+ 8. Evaluate Statement.
+ 9. If Result(8) is a value completion, change C to be "normal completion
+ after value V" where V is the value carried by Result(8).
+ 10. If Result(8) is a break completion, go to step 14.
+ 11. If Result(8) is a continue completion, go to step 5.
+ 12. If Result(8) is a return completion, return Result(8).
+ 13. Go to step 5.
+ 14. Return C.
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "statement-003";
+var VERSION = "JS1_4";
+var TITLE = "The for..in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var o = new MyObject();
+ var result = 0;
+
+ eval("for ( this in o) {\n"
+ + "result += this[p];\n"
+ + "}\n");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "bad left-hand side expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyObject() {
+ this.value = 2;
+ this[0] = 4;
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..1899b07d73baaa33e2ae09e9d7df48a943540ab5
GIT binary patch
literal 1087
zc${rg|7+Sn6u%uIgb*YI5fLeeh*;Z-8&XQ!ZLQ9BmTHR${YA<+lUL0a6S-V!W$drp
zAF;n;|HGc9Hl-|qyZ1hycc1s=uG1f0*<^e<Iv)(qNB6!5q4eeI<d1q-?{Az3A4KnI
zAs~+ZC~RK)5(E!yDg1Dn;gyabdWd9aY8h!uE@6&D?T!ndPXhP?ZombXNLJrskzgps
z#VQjhcX<$GZv7m$X}DI*K>gb=34*dS^WzL`J(oL7<{*4GBT7S9zB=0pBKJo-lXbY5
zg3Ow!A_YQ%w+Xb}XaQ^sVf`DRc9Decx}#UkRUEPEa_P=qMqt>k@E7uE4fyT=<`WQa
z^A@*Coyc3AcBA<s!94$u-G42Vb+j`AnTTxi>>?6#9^7JGbHI_rg-u!AfG07GZD-UU
zUfS99e^x%Jk6h5boZag>{hOf$PcAIhH5u@<09P8AC<&xFSlvv%qpv%C=ekED3c0)9
z$i^cktIL^yC9`75g>)d6l+j<t1@{B+=x!}lV0#~##7i45?oV_L9(hn3M(iaWaw1xW
z4QB@IArj4|AF_Dcm5$K~7`Gg+!mA?9>a4;m3}d2Q_ESHeaE}G>AP;6d^jM7jq4IV{
zn#7XWQs5K$3fu$XMAy-@^rC*yYPIz%`~A1Jxh}rTV=!fuzWlK>>h-dD{iQXgP{YhA
zxxA{GIwkKY`Av%&F{rL6^e{E@^e8oQw65kzkrG_n1!~|=6j~y=l-B7^YN)i98XDcN
zmUbvX;bTQ37D8qbnYBPQ6`)O8q2;z>m8`0wnq{46xT?7(u}(3rNRAsCQH(UUMGHiw
qjA%qhg%6Ze2(c{1K+9@SGE`Nwo^KRL`kkrfetzqaXTv;e<^KU7#X)=k
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-004.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-004.js
+ Corresponds To: 12.6.3-1.js
+ ECMA Section: 12.6.3 The for...in Statement
+ Description:
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "statement-004";
+var VERSION = "JS1_4";
+var TITLE = "The for..in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var o = new MyObject();
+
+ eval("for ( \"a\" in o) {\n"
+ + "result += this[p];\n"
+ + "}");
+
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "bad left-hand side expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
+function MyObject() {
+ this.value = 2;
+ this[0] = 4;
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..09bdd3ef289c04d41504b40d51c01c4c55fe1703
GIT binary patch
literal 1097
zc${5QVQb<*5ZzlsPC^JlL_|au5wW%vuXv@`_KsH1_AJ#F6Z%C;S(B;eE+(>BYvs7#
zd7tjT+-RziCJ<)d%)B@ICarG&#v;S(!DX*^Ie7G32&5;MXMfe>YIl8j_CR!AX9A+g
z3xoQtCqZ!ElEMqd30_G;OL7TQY%R6Cz{RSBr~JT$$45SV2gm1v%TO>Z;$peO^u7kM
z>LsSe!HP5~EVQ}rC&$LyWc~RRgy$p)?WsTa{boX8b1?>)OjWQaUX;}5`>@#QZuz0}
z>tJ;$&*{N*wChIhY92VN0b8NFEZJh&=F*vL4PdAVLV}A|vYc=R<qfbVT|?*Xa5|eK
z6m!3yGP`DM`+OcjaR72I5`QZj^&O{l%Msp8va3)`xqpx76wsFFWcLE^MTV9===QIz
zWc^>1Z|VydbYI7t&V8xF>kJ%eSe>@rz3Zpp)q&Yc&+IMlMn5s7*<Jg#V?1;Q78X#T
zVeuKaTm8hmfQ5VPw^r$gY}?1=M1+eV9Z4>v4UyEZxaWhLf*0<yg}`0@0PcdY!`pDI
zAvg!RXUZ`C@lHqFWj;L1!wC;u7UAH?y;%!oHG2XK_3L$1k2Z#BH`b@8rpc-(4hxpw
zCJq~o&nbyhn5$9RJOcfm<EmWck5-NyVEbQjW-l7f9?ypMpwmgr`lvL@3e`;`Wtf_p
zQ7HL9$v>LYiB3~$iXO#*N$YW7&;!LJc}nohvQ)#Dq-c#8aay5;IM6l}Dm^I`DwH6x
zt?DF=P$rKVq8M2vP2L`4E5>XzOV8<PO-&avWo1=ERQzgYk))AD$&=$+ilnr-wn`gB
qqh+EJ1sR%@)CtLCRQ-sO45Orvt<79%qjI4b)!bI{Eif+*a{mE*J3w;)
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-005.js
@@ -0,0 +1,51 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-005.js
+ Corresponds To: 12.6.3-8-n.js
+ ECMA Section: 12.6.3 The for...in Statement
+ Description:
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "statement-005";
+var VERSION = "JS1_4";
+var TITLE = "The for..in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var o = new MyObject();
+ result = 0;
+
+ eval("for (1 in o) {\n"
+ + "result += this[p];"
+ + "}\n");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "bad left-hand side expression" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyObject() {
+ this.value = 2;
+ this[0] = 4;
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..31853692e9f368db5f82ec664474657f9a99ac19
GIT binary patch
literal 1120
zc${rgZENB{5MGuggj|piL`0+n5%FwKydp(<J!tFMo~5S6gu+pdvL>VMUChd6Q|r&|
zKe_d##w*Q-&AdD_&oi@o*>`U|^mskI7z{3kzgY;eWODiKmws07ubnXi(R-N-ND{{5
z$|Z|K7EiKV^Oi{vH1ecS@eEnZOixk?GgVN1pn}m+1V12%sGyRI+WU~g8&7T;MUJAP
zVwtsRZJFG327(1yqU=vuvgdYb6lHGxLj5N3ia!gsv!GAK1Y|alaT)R8Z^?zl-Y{2b
z9IT}6sqC!AV!;4rBM|S~IagfFXmqczGf=9Nvo4>_Qwib6_@n)18SlXmWGb=+c2-?@
z8iyav)cT)dZy`!dKfW7p@6J)hAQVom-V68~D!y2DsSKt&o=wHhHN8Nvxh%eI;gW~T
z!n&dx(KLZa&mZ>PYcG30ulQ7ZrovPT(n#V%%uRTiLm+cruj}{kTpL~jn6Gc!@B6ns
zYp}c<{ZRl6xrg4+QxN>Ql)NeU(rTSx$GoB}g0R8YNQWg(%%u~;n8gq}3!&b}PoN<P
zpWpHcIs9%s(<p_S%bgvaBd3BdV)LG=Erga2iR{t@j2rLkQ(GHzu1giN6|<15q$T<0
zX<JTRmBPYl_)~DkTr`_3c6JIM{b8?{E#MP5X%TE$IU|=hbq!;LFnYyB1DROI2H6^U
za<nmWq@(50F-Gci3d+q9WRMcdZPJ*OH-<@S8$&1c<B~bj3}h=$D<cad1C>@-3vIu4
z6JZTCOJ*KxjY<(8*+@IZcFC*~tx&{BSEre;A-k=3%c#-Nk+EXV5pqCIkVy(iR~_=G
jh0y^*rirZzMrH>iSJMiPU43IZ*9uj8N4qtw^Sb>HbaPB&
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-006.js
@@ -0,0 +1,51 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-006.js
+ Corresponds To: 12.6.3-9-n.js
+ ECMA Section: 12.6.3 The for...in Statement
+ Description:
+
+ Author: christine@netscape.com
+ Date: 11 september 1997
+*/
+var SECTION = "statement-006";
+var VERSION = "JS1_4";
+var TITLE = "The for..in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var o = new MyObject();
+ var result = 0;
+ for ( var o in foo) {
+ result += this[o];
+ }
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "object is not defined" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+function MyObject() {
+ this.value = 2;
+ this[0] = 4;
+ return this;
+}
new file mode 100644
index 0000000000000000000000000000000000000000..c4ccde5a8970aa3438baf7bb3afbe39516390820
GIT binary patch
literal 811
zc${5QQH$C@5Z(?Ugs_AVL=KT-5fOW}S6hTW+>=^+_0Y7K^j@SKd&!)J=CZO`PyG%3
z$$jaXpgBrlGyBba-+Z&Xqp5!vkmc=SIG+y}zmga;m8iqbAEVQq7MrI8<z&B+nCFSe
zu4jot$<si|BwJN@Ym{WMMk-FHN(PE6eAbEfJ(mf8Oz{gwDVJOc+4&#R_02I)(~8ct
zHkXGA=nnO7l^qo;a8Q9Emn&426?>G5=r_{^C>6%KV-SfAHhkQ@njn;iF;~&La(f~a
z^ny|^D#j__=17A`CL3ix_}et?9a%{<$LGh_$F&T?#nitIs)PLt1M`JTc<13h!p(79
zCzy=G>35&veuI&sn!8Pv9Ztj91kkykECQXi6y^%v(jQ#AioINMsX`5Pe8J9AOs%EZ
zWsUqa!~1^!GyTew6l1oN`tH6Vk5PtVCRP@{@YIWhHkNJi#=Z+aJ`BRso{6o>wQVMz
z7|&R7?L~{TwyQ+>41l?;t2^V4xkpQ5o?|auBRgxIIm>V{nN+9o6IdOHLrv-$mJQ?$
zkPlF|2?fhAp;-nlbjpCjCzFy3AbQn2M}NeG9-(F0hRZTApiu@E)El)X5H0M1Cbdj}
r_NC#}T5ZF0J)2m1HE5eSS6b<U^sg*pI)yNF;hGpwBNnkW(*yDk3B2;7
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-007.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-007.js
+ Corresponds To: 12.7-1-n.js
+ ECMA Section: 12.7 The continue statement
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "statement-007";
+var VERSION = "JS1_4";
+var TITLE = "The continue statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("continue;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "continue outside of an iteration statement" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..004f9900cd29fffcc6089766b9c10ebbc130ce48
GIT binary patch
literal 805
zc${5QQES^U5Y`T3j1k6|5=IF{gb=bW>#~xEL7$S$>rxVL#9m**D2jbeL|r?`N|XGC
z{n-75DK?GAFr4r1yYJK8Nux<{7m~&8d^np8=f6aPnG))7^V{fjCuQ&`Q2P6g#G(*+
zb~P0WB~L>oMYgK*t&zwQovAsU8VnUz_^g4>J(q$nQ~ZK)$|YACZ2zCjCDUSD9%_N+
zn5StSc8B`6%8rV4(jKLG{4}Vch|3kKx*;0IQfyRPSD;jwl=WepZ?G}uDqfFMzAf-P
zz+ElMUW;{;WvTrTY}2$A$wSFGP1ZYlBA(&%^51nW!e~ATZo_)9e_&v~a0%}z?l%}K
zsw=mt@^ByH=C}_h^vBWUdtgVCXzBwx_x?Q8vCFz@Epf-_QX+r4@e0MIim*_Y(#BPJ
zbtj!5XD2bHDfup=U%5yzvG9eb?vXO)deY*x`49d6XJGKI7p;+%>P%$p1k)c}Zy~Yo
z!cPx_pu+R5D)dY&e`Gvk<(nwaJCWE<>g+e<3Cbv+=Bq_C_x*YgKcR5}#Gy8IEyD!z
z2FOQfScHOY*wC&V7p^LY!lmhu1`utp8$k6(Z0HbL!6sZ(js?xiF`(D--U89W9%vFX
r0nW}1$75~7bk9t3w3gE*&bbzClGdd~Y+4FKA3S0~ml(v<OfB*khzajw
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-008.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: statement-008.js
+ Corresponds To: 12.8-1-n.js
+ ECMA Section: 12.8 The break statement
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "statement-008";
+var VERSION = "JS1_4";
+var TITLE = "The break in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("break;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "break outside of an iteration statement" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..b5a30ab63102bf48321d9b7cc3721dae50011009
GIT binary patch
literal 805
zc${rgQH$C@5Z(?Ugb+dykwfHIM69)UQjdFRxhGB2t3}gd!o5g2_L5OU_Y&D`PW=u2
z!F}z<^e&~8z~sx!_kA-v+3C#x5|GvHa<W)Vmfw>YQ<=!)%}=dAn4Lb>2@3D96PV{o
zmX79$M8S9<MUrmne7}Z)WD*~hv^!1GSg~rK-W?MOd*JvHBhCbqndtwUQVt!Lab6oz
z<-^3WPFzpaYm=5eLMApS>kfmuRP)U#&!Qg}<zPv)z{iKbPt;Qi6cXbTDTuNiT0ta|
zoou;GMq8J&B1ihnQsbUD-B27)^_SzC_kO{7+sA!vz6!$S%)brl#r}e8{fP++4?B#c
z9e8dy`|4YYUvSyLLxj6>1@IQo3}@lov+ulRpeP1DF%EC6Z%j=RJL9X-hs*J0YI*Kr
zazC~{v4mqh2)9TD%0i?xe;&-C1GyErr+q)8FCD1LW&6~Sm`f*A!DTtV|D(+cnX8d$
zwx*1(i!>?~c2&G_WLEwDhH4>XsU6b)HKu!^Zp&w6F^VvoXPZ^H^t^f(3uvDMu`SJZ
z4A6nR0`eMKCb7WKH8`t)1MLdfaIRTo1VqIv8*Gzk@UAN9(5Zj{-3kD-X!8t+GHrko
tG*o8T(XD2;r)dpGC!nHXwTN}0411(MG>B%K<pTqt#DJ#K>Pp!I@*9t8@R0xj
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/statement-009.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: 12.9-1-n.js
+ ECMA Section: 12.9 The return statement
+ Description:
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "12.9-1-n";
+var VERSION = "ECMA_1";
+var TITLE = "The return statement";
+
+startTest();
+writeHeaderToLog( SECTION + " The return statement");
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ eval("return;");
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "return outside of a function" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..354c060b46d98f9ce34f456034d2e7265bd3b65b
GIT binary patch
literal 906
zc${@nU2EGw5IhbcggA^4!Wa|6VT^Io)HueJP}7IlbrT1F6iejAlyH_ej#@=hPnSA=
z>3e@g|7uqjv5cV{EVFa7vwM5}(e%zGi<|lNWO6<K7OWsrf!g-|YK`V-mpld_hp&l*
zG!5dYH4YR=5xPnS(YoLp1$32A@QkIkeh{rtRrs6?L>LxIjshXK2QK$Q24We)XYfNI
zg+i`=%*C>Kjp}uj^(bn)1?dU72354Z$VLkM2|O<k-(o&YU&63Dh0Oui4`csFc_5Vk
zGzi5@3LJewDp=tht{*4BTwex>x;ivH?p^cbcIUBQ#=`aHqv?%XtoWz)QU4_*eaEo(
zOQ>vk^&!cg%-}TvUs)>7*IaUk18+2&vRVHQk?D=R@sL94emHlLZcJmoujT4V#+%6E
zO$4yv?5n`}SHF2)+j{flpLh;hiHudOwh8R-ddK4C8Q)0!_*)PwkX}5F*LJFeR34<t
z%ECaTxR{;TP?)nXA_!q+-no|#U3y0Od2WeqBb;is{EiRo@y>r|u=f<p#ZJ28-?!VB
z3vWIg7K{8t`6(qO#w<rSG)f31J}ooCXh~=EDhCcd&w)idnn5@v7*EU8#Djc`SoyU^
zn>o<mEDTz$SIf7$X4$0*`GAF1jg(BoaY(&uW~r?i4l<OS=ytVS*D{6}7<J_BOj04W
YjzO47^F!P8gjR@7FNi@j9Hc?XKPa&Z&j0`b
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/string-001.js
@@ -0,0 +1,53 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: string-001.js
+ Corresponds To: 15.5.4.2-2-n.js
+ ECMA Section: 15.5.4.2 String.prototype.toString()
+
+ Description: Returns this string value. Note that, for a String
+ object, the toString() method happens to return the same
+ thing as the valueOf() method.
+
+ The toString function is not generic; it generates a
+ runtime error if its this value is not a String object.
+ Therefore it connot be transferred to the other kinds of
+ objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 1 october 1997
+*/
+var SECTION = "string-001";
+var VERSION = "JS1_4";
+var TITLE = "String.prototype.toString";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ OBJECT = new Object();
+ OBJECT.toString = String.prototype.toString();
+ result = OBJECT.toString();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "OBJECT = new Object; "+
+ " OBJECT.toString = String.prototype.toString; OBJECT.toString()" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..f4dae1f00bebb27737cbeff429d42101755757d4
GIT binary patch
literal 919
zc${@n!D`z;5M2f#gjj?S#sm|BFvd7-YTRH-sM|yAx`|C<7fa+4O4!H~N39}>)jEzZ
zy_bGOf3;(8YlT2rSk1h7Gw*4(KbnjKc6~NGy}Ue~eU0ass#vXizl~;Vv`y|}l*6Z7
zVo}6d+P;VtN|6Lg#_6KOn`Ia%q40rP>-{*L6RVulyb>}Nw+Vj2C=pU9qBmY*ne?eq
z$aOh#e;|^iOpi7aade3fx6i$`PU*8qH_|28Ex}O81*+0bZGx+kXx~hhNn-btEc$-(
zT;SyZp8%8!=VUyHvK;H7Tn~hb?stFAgGk1?s&3IiB9;YS2jOfqISa}a|1>_Bk3zz0
zP7aod;`o$fq?}+l2uIV2hffjan+@@4e@vM3D3T>k@9c0CUJRY9;Vd8;ApauB(A*8N
zPy<n*zmoJu=P2eV!|WnkxGK}n1&4fk`;9dCXAvhjx5vTTn{HRj`yYL+)BdZ|I_$ZA
zOWjLc`ITZj;7zA<{6n*do>D>2>%C~DqE>9@GE<pa=lHMG^9m)T+L#5u^FNlQsP64x
zu6fN#=I^%Rle27<UWc>cuw3dds2>1x9d5avZ5qHBun4La<6xT>ywZUO4IQ{}Y&fh9
zjP6<$I2~p|hq=0JKwSqmyw`yVRll}(Zd%Nvj8~aYz1}|Kj_b0McaGsz49BGuSi`K;
m_8P_pVJ6)+;gx-&SJ~dN#Vii`z!5Z|#cViWCNs!L7uX-sNDln~
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Exceptions/string-002.js
@@ -0,0 +1,52 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: string-002.js
+ Corresponds To: 15.5.4.3-3-n.js
+ ECMA Section: 15.5.4.3 String.prototype.valueOf()
+
+ Description: Returns this string value.
+
+ The valueOf function is not generic; it generates a
+ runtime error if its this value is not a String object.
+ Therefore it connot be transferred to the other kinds of
+ objects for use as a method.
+
+ Author: christine@netscape.com
+ Date: 1 october 1997
+*/
+var SECTION = "string-002";
+var VERSION = "JS1_4";
+var TITLE = "String.prototype.valueOf";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var result = "Failed";
+var exception = "No exception thrown";
+var expect = "Passed";
+
+try {
+ var OBJECT =new Object();
+ OBJECT.valueOf = String.prototype.valueOf;
+ result = OBJECT.valueOf();
+} catch ( e ) {
+ result = expect;
+ exception = e.toString();
+}
+
+new TestCase(
+ SECTION,
+ "OBJECT = new Object; OBJECT.valueOf = String.prototype.valueOf;"+
+ "result = OBJECT.valueOf();" +
+ " (threw " + exception +")",
+ expect,
+ result );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..838e6741e142b6e74bd37fa216504b864827322a
GIT binary patch
literal 893
zc${5P?TXq!6umoyVF)3Jh=_z`5E0w%iY{fL6o07A?pic0ChQ+6%QViqftc9I*wqK>
z1N9;L2>suQi92l*n7QZNb3bQ1^*;Kryj_gu^U>l<wBm`3<l+4<quZSx!DGaQyWa|)
zWl@@RwCPJG`9?|lvq*Bm;&GbBoF!V}OjsOi*ei9u6j8F)d}|yfE5+z~O^-ioKUIDv
z4w`7+GZC?`G5^5Bm<c9R(fOZJGV{UP#qp^-Z@1wh3U!vo%`ORZ-8fwxx+BG{lYAVl
zu>4R&TX~^;Tu8q9tP*dy%I1gZmUm9^f0d*+so1diMVQf3tm^L=^;Q=Om{@bEr(XKO
zV(Q)c`W1elD<|JpDBW*67Awm3-AOS0<e>xhn1}Z0jm7s{9!mV32{V`mGuJBiYdl4E
z`68B@XBSKR-d*^4EG3d>vJ$9c!ZKdXBoi`6cfk{<*|8wyWksr*KCYN{>2Nrtugv3x
z)dBQbsO8>qw&Eg4XX)B<C-c$6)%CwkU-tV0dPxU^-n-uQGFZ5-9`QGF+6DrGQKe}h
z1PFd2r)pcMVj|Knj3((7MuoHyhL%!cxTquBv`s+7fr`S=z{Z&cb&QNNBNspoD~P~=
z6C|%KsG<@!l(&izsgYVi*cjAb*p9O5P<|)sg(y|$2q?fg!4^>yK+S}fjZI=2rd4Yo
a7#pbBY1myLU?2-<i$KvaAsv;|g2o@^`11V#
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Expressions/StrictEquality-001.js
@@ -0,0 +1,73 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: StrictEquality-001.js
+ * ECMA Section: 11.9.6.js
+ * Description:
+ *
+ * Author: christine@netscape.com
+ * Date: 4 september 1998
+ */
+var SECTION = "StrictEquality-001 - 11.9.6";
+var VERSION = "ECMA_2";
+var TITLE = "The strict equality operator ( === )";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+
+// 1. If Type(x) is different from Type(y) return false
+
+StrictEquality( true, new Boolean(true), false );
+StrictEquality( new Boolean(), false, false );
+StrictEquality( "", new String(), false );
+StrictEquality( new String("hi"), "hi", false );
+
+// 2. If Type(x) is not Number go to step 9.
+
+// 3. If x is NaN, return false
+StrictEquality( NaN, NaN, false );
+StrictEquality( NaN, 0, false );
+
+// 4. If y is NaN, return false.
+StrictEquality( 0, NaN, false );
+
+// 5. if x is the same number value as y, return true
+
+// 6. If x is +0 and y is -0, return true
+
+// 7. If x is -0 and y is +0, return true
+
+// 8. Return false.
+
+
+// 9. If Type(x) is String, then return true if x and y are exactly
+// the same sequence of characters ( same length and same characters
+// in corresponding positions.) Otherwise return false.
+
+// 10. If Type(x) is Boolean, return true if x and y are both true or
+// both false. otherwise return false.
+
+
+// Return true if x and y refer to the same object. Otherwise return
+// false.
+
+// Return false.
+
+
+test();
+
+function StrictEquality( x, y, expect ) {
+ result = ( x === y );
+
+ new TestCase(
+ SECTION,
+ x +" === " + y,
+ expect,
+ result );
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..9652359417e8f3b1b4b2df31739f7fbd3e33ba47
GIT binary patch
literal 711
zc${5PYirvu6xA-q7-KRMf(aoM5lWVAZD_JmM)%1{)XXFCg5{J!7)7;}%;4BYRv-CU
z{bTzLQ~JPRUnJdg&pG#@k>~%QXf+Mo`P>bDCo#`tB6r`Y*6Gg@$puTP6iK!rkA>i6
zndDi|dnT<DE-J8FJ*i}pZxy9IW@%dCol%m-%Bhl@H~w9kcCVR8*lo%uJW82hQgM&}
z$8vG*Dwj>RHx8NDa9R0a<;=wHpv8(?ffkKKQplFiA1bhUb(cl^ilaQ<VI|{2@>o@;
zQC{%wTlSzee3gqWOBX8Ka<!mxMZ>`Jr?gt$6P(m28He6a-weHQM)Z3o&ewfb6zQ%v
zJQ;q(an8%^gT#?w<sXv^kqcOxh1#@)&$Vk3P$jlQUdk~mdGk<fk@4KU8Q{@!>M!Rb
z5?tcp;OmzQ{2<haedjFZBFty`rd~=W<le)O>bRhx8!qW3el>fkjrXa(Ga+;wc#D0@
z2ES*i^GrECI~$y4fNk<?q2?izRTvOb4f-COwg#r5Bd`Iz1N674>0s%A@ax??LdY}?
z69Y0^fB;#V1vLYq?#shQj$*doa6q~WTMpD~^%@}51JD|FN1+Y-6Ed_W)Z2=LbY$po
Lto$2_egx<rq3Y1o
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/FunctionObjects/apply-001-n.js
@@ -0,0 +1,29 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+print("STATUS: f.apply crash test.");
+
+print("BUGNUMBER: 21836");
+
+function f ()
+{
+}
+
+var SECTION = "apply-001-n";
+var VERSION = "ECMA_1";
+startTest();
+var TITLE = "f.apply(2,2) doesn't crash";
+
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DESCRIPTION = "f.apply(2,2) doesn't crash";
+EXPECTED = "error";
+
+new TestCase( SECTION, "f.apply(2,2) doesn't crash", "error", eval("f.apply(2,2)") );
+
+test();
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..8b5bb59afc939d1829f028a989474907b6db5b54
GIT binary patch
literal 885
zc$}4y-;3Hn5XYA#gb+dy5fM2gh={f}w7&MGYID}&kCKFYk#b$*c-<1SvRS?QNA!R0
ztUoSt^rbJm-<_H7XC{;3Wd1cG%W*iE%?9CjzJ^S3b^Q3pXm=*3$A*Ipe(xmYITx8f
z<q9NABPDtERK)K_EKQ4NyO5D$3bsh<X~mNnY*)9$=8$J=WEI`&b9gTDtp_GKTcz+B
zl9WlNg!ItD<ngB6>l!^#{FCQJiTya=r>Qr{bC3$wXowQA11Cx(-zo22$Sq61p?3@T
zfq5eYwU@>4?fZR}XzWdg-WB#@J0WY=(xF%%mr)!}=HsZ??9u4EQ80=pi+N)tvI7!g
zabBl86e0zd+3_Tv23CSAEya+l5zE08t6%i3d0?`<lR^n~+=2TLgb{M=4NG$%PB5Ac
z9{b+2#DDY!*cxOkrsC<-t2Vv{cNDIt=jpTSUnllo(5D(lAMZZ=_^1CeYtOrg!rLw9
zieWiU?jBgWhsDMjPZz_%)KVCup88Lqf1z}`-DMmGL9t9u>otQ?%Oqxn5<<zCR>~!Z
zx;CNBv#8MeS(wx_4br9r&$}uuxg{4JJ~2&)*q(*DLEab^L7Gvi=wL?&TeNx#x(319
tDC<ODC*EHYHB1<mPIXS~9wi<jO@lf(QPrk*CbgYvi;@y;U`vPA{sK5K3h4j<
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/FunctionObjects/call-1.js
@@ -0,0 +1,42 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: call-1.js
+ Section: Function.prototype.call
+ Description:
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "call-1";
+var VERSION = "ECMA_2";
+var TITLE = "Function.prototype.call";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+new TestCase( SECTION,
+ "ConvertToString.call(this, this)",
+ GLOBAL,
+ ConvertToString.call(this, this));
+
+new TestCase( SECTION,
+ "ConvertToString.call(Boolean, Boolean.prototype)",
+ "false",
+ ConvertToString.call(Boolean, Boolean.prototype));
+
+new TestCase( SECTION,
+ "ConvertToString.call(Boolean, Boolean.prototype.valueOf())",
+ "false",
+ ConvertToString.call(Boolean, Boolean.prototype.valueOf()));
+
+test();
+
+function ConvertToString(obj) {
+ return obj +"";
+}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..c6f5f6ceef046b4302b2610e15f86d212d8a16a9
GIT binary patch
literal 891
zc${5QQES^U5Y~h+!Wa`mFlCgYg^-0(!dCXyr!+GqTa&Ta>q{9$wJ(i2$Mz&SZGP$g
z&d$zSw|lU4r|<NA-<@<mTYQPg^~G{BpHG%QRSLOPc6auN9gk*BvQnVK$5Mkas>lzg
zGRxX@e5ovGnMGEs{I1;}wqazYg$**fH;XFE`sXT7v9={2UP-OwZ3dqq$)uJR54q=A
zk^CC`j}-c(rc=orHn%Tr1+&$&&XcDl)P~xcqaV4{yEY$8i~(&SZM34KDB%-ssk^*p
ziKV^++q&$>dN-9eSwHIpO*+kFWnk1EYz4e1(W<lpJANfBo`kWzM)o?2m$Su1)Q<ln
z`{Zn;_KUKfhVk%Zm03a`-FOyXhC#H;t$Yl%E;N1TUxmwP_HE%u;WWn8Gk6<`bvLy?
z?*ZznuCY?v7>q3|gX0%=4FXzAeN&a#q%iBE%F_J36-nKfxHrNUBGJ;UgGrj!1XF3C
zr*b6B6DU?3wld=ufo;52SdNj<@VipTE%ptFd%2aSna22EOXIys0eOAFskf2}m(Ew%
zJrp`MZix@ddX1|yFPzRNH>W(88@P^_Vb~7J(7}ijmv`L`qvQ=G-)Z0xk9OQHbM`@p
zeb@&sJ9a2}O9}o@9Lk2h1D|#&p_Bxi20h2;U5XfftjAx22QR?`z9(dCbmSu+3O86E
jv9WNu&-=7D6oeDc=^wH#;inwoBi~_%%p(lr0VRI{*7OcR
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/LexicalConventions/keywords-001.js
@@ -0,0 +1,48 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name:
+ * ECMA Section:
+ * Description:
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "";
+var VERSION = "ECMA_2";
+var TITLE = "Keywords";
+
+startTest();
+
+print("This test requires option javascript.options.strict enabled");
+
+if (!options().match(/strict/))
+{
+ options('strict');
+}
+if (!options().match(/werror/))
+{
+ options('werror');
+}
+
+var result = "failed";
+
+try {
+ eval("super;");
+}
+catch (x) {
+ if (x instanceof SyntaxError)
+ result = x.name;
+}
+
+AddTestCase(
+ "using the expression \"super\" shouldn't cause js to crash",
+ "SyntaxError",
+ result );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..15f84155a0ef39aa301b772938abbf9dd4caba02
GIT binary patch
literal 805
zc${64QES^U5XXfuCIk^mRzfJDh!R35YtxOfm(d3|GbJO*!1nqQ#!&1_s^VHkQo7_D
z?2GM7?33(q=Qu;zo^<-(-S7T7-A(47VzRi8g4ryHzRC;=EA8&XE3bDwl@_$fW2<Gc
z4!5NSW27pElYP-jf_7qWEb`o42QG}Qu<(o>7k9GAkmTC?4?;_^%;6)XxzNHYJ@{Wj
z0>?(7cMf?uR!FK+;%Mgimw&5xU<_yr86x9Ul`up>u8Ycxt9s|eMCdhGXOG3HmZe?9
zNi><?$8I@4y-QXKq-WH0f-FnG*s(C+zX;t-CdoAPZf{$0I8G*?=dFh@it%JCA#=!>
z-IbtL(G<2a6*<1-rJ}0Bj5MraTVCb$+RfF?&712dQ;tU5JgQBe@g;D<Q}tY#ea#DH
z@rq3wToecQ?gQX`bVwbo<nX1YVbL<Hf0n7`6Qq`f<5}?S?GGGRTjaHVG`!NeOJw^m
zf{Y`0rSe>TM;cBqfSEmc>8w{~HQ0?VxG4St5M>_^STu`1+r|oQt9>q#C=A`of1jOF
z((qZMMG2wgSDX2aHXDqb)<KK#I%trt@6jP8ey5A27<*lxbO`Zi&!?1DLf<DBgq*aR
W?KY*PPcS~n11F!8lYRRcC4T^P`2Y?8
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/LexicalConventions/regexp-literals-001.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: LexicalConventions/regexp-literals-001.js
+ * ECMA Section: 7.8.5
+ * Description:
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "LexicalConventions/regexp-literals-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "Regular Expression Literals";
+
+startTest();
+
+// Regular Expression Literals may not be empty; // should be regarded
+// as a comment, not a RegExp literal.
+
+s = //;
+
+ "passed";
+
+AddTestCase(
+ "// should be a comment, not a regular expression literal",
+ "passed",
+ String(s));
+
+AddTestCase(
+ "// typeof object should be type of object declared on following line",
+ "passed",
+ (typeof s) == "string" ? "passed" : "failed" );
+
+AddTestCase(
+ "// should not return an object of the type RegExp",
+ "passed",
+ (typeof s == "object") ? "failed" : "passed" );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..3db1f4607fa0c57cadbc00d300548fca116c268f
GIT binary patch
literal 601
zc${5P(Q4Z;6cxf46HF*2gi=ZoVU#k~r1YULeR5n=JdzYF)0a?+V&4=MR|?W?Nnjta
zZ`l9rBlb6w>kO5>NLNSqoO_Nm%@^M}S>6@Ne4Z4KvId0`cQ?Q3(Rd~ijA%F-sh+d#
z#(=d_tMmM$X)VEc@FW#Y<Bw;)<R}nc9b+_=s&-1Ae)b@Y6srbqp=yK?=-R*hk7@I*
zm5|jOURR$-#=J6egDkNY3_|UQywV$BZjLZJ-}o;`0c{G8FL_zyi#zU9|DmJsU6}qu
zR`C3O(dSuOy1iHC<t!T}bzOqRR9F~DWl^XK^tzbAR#u`(wR&%5w6YTe&#>KGG~HZ#
zad~+)ez9?u&XcFBVEdIEI<~=9?b^9|b3vK+#rA$}+&PZW^&Oz@KH}$O!V+foEby%T
zG<VfP&WdG1F}-?$3YlIr+_|^u6vq*oH&~WMmih3%4h|`a!XTuS5K4Z;JrdJ63dp{o
gq~8@G8HNEJP~z5T6p~ZIg8ra4bo`@}5A>Llzlc7>B>(^b
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/LexicalConventions/regexp-literals-002.js
@@ -0,0 +1,28 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: LexicalConventions/regexp-literals-002.js
+ * ECMA Section: 7.8.5
+ * Description: Based on ECMA 2 Draft 8 October 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "LexicalConventions/regexp-literals-002.js";
+var VERSION = "ECMA_2";
+var TITLE = "Regular Expression Literals";
+
+startTest();
+
+// A regular expression literal represents an object of type RegExp.
+
+AddTestCase(
+ "// A regular expression literal represents an object of type RegExp.",
+ "true",
+ (/x*/ instanceof RegExp).toString() );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..58819900450320343c5a8094a075bbb0fcfaeaa8
GIT binary patch
literal 996
zc${@o|7+Sn6hDp-f&`HuA|et>k=Qxsq>R$;3+h72sCFcwzepKp@+P;%oLtVe{<6P)
z7nAlRun>6f^LgJs?<F&D`7J=JTYtJ(O#Me1Ln^2^+#EF9@s8jp1@1oYIAj@R>FACM
z;3NqIr|CxV-8o4T1^dbk1QD>6orbwbqXlf&ryb8`G>v61HLd?ZI3?=@zCx4`E{j-t
zUga1cmr`boB|uWu@g=a_Z-LWD1v*Q3QplEr2|t_=(<}onAeOU&i0$C&RIv=wO`0zf
z621Xp1`($_;V52pS_Pr+EpG#LPpW^`IJBm596~1MBm?~q;ieDy4Xqt#f{DWpYM~e2
zxwdRSPe_)1=TZe1hkD@7L+^fBe{lUk+Od<ulU)=$gTYAV3NMY}xwm5LUl55h_K4qD
z+kGNvLQ}Y?6lHABBQOgyEcka3OEbauk-YEQ@%X*re7PQ&?tC%*F=@&*8HZf^-y(bT
zs(VybY=5%vk4jE*1S|fU8`}`_2-d4=D-(o^{4i!wRNe2tJ8TlRCW%>?#>;?NHLD`d
z8B8h}YPI%hU={kVt3Kjy+-+l2GwQVl!brXz?wFd1>$N)W6;1=66;2I*)HO83NbhwF
zq#LGTppo&x)GQf9O{B|+hOn)-TDXs|a8ol7G7HkuaR=KHcS|&BAc-zZbbUnUB^n=5
RyJ&_j3zd%~FC^(;^bglgFQotg
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/constructor-001.js
@@ -0,0 +1,66 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/constructor-001.js
+ * ECMA Section: 15.7.3.3
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/constructor-001";
+var VERSION = "ECMA_2";
+var TITLE = "new RegExp()";
+
+startTest();
+
+/*
+ * for each test case, verify:
+ * - verify that [[Class]] property is RegExp
+ * - prototype property should be set to RegExp.prototype
+ * - source is set to the empty string
+ * - global property is set to false
+ * - ignoreCase property is set to false
+ * - multiline property is set to false
+ * - lastIndex property is set to 0
+ */
+
+RegExp.prototype.getClassProperty = Object.prototype.toString;
+var re = new RegExp();
+
+AddTestCase(
+ "RegExp.prototype.getClassProperty = Object.prototype.toString; " +
+ "(new RegExp()).getClassProperty()",
+ "[object RegExp]",
+ re.getClassProperty() );
+
+AddTestCase(
+ "(new RegExp()).source",
+ "(?:)",
+ re.source );
+
+AddTestCase(
+ "(new RegExp()).global",
+ false,
+ re.global );
+
+AddTestCase(
+ "(new RegExp()).ignoreCase",
+ false,
+ re.ignoreCase );
+
+AddTestCase(
+ "(new RegExp()).multiline",
+ false,
+ re.multiline );
+
+AddTestCase(
+ "(new RegExp()).lastIndex",
+ 0,
+ re.lastIndex );
+
+test()
new file mode 100644
index 0000000000000000000000000000000000000000..10d5403aa4ea523bca24dd4bab2250b9a3943446
GIT binary patch
literal 1846
zc$|$=U2Ee;6uk^W2qA<q#u#Hv5NVK{)OFMB61KY~PVDS@N!-OYq15^4NHa;)l`UJ6
zmr*gLlu}A5rL?8=kL_>iYiA_cino1O4UA^)IrrQ<XXd!qe>sHl^FjOkygj&b37tl6
z6o2}G+-#n?5e=|6i~@Ih*JZPShN0_E&0a#fb!m_XYbV(A^6gH(97Z^z6Q0q^^!kel
z4O}N@Y#qB(9K?BGRe3-~**sov2LXP-+Y{QZb51Ar!(I%oM|jJ5pXyD2;dza90~@Vg
z;K0SUM?2K<aKHuq>Gr!ZKTwZ7-+8^)4nrD5l)U263FUG_$Dh%i)5X*gi4Qcip%b{X
zXzSDuCfHl^!^(<#?2~wFrN;{<O6A_|+OYb7MvEXfa6B9hdj03a{FdG-f7jZCq&}VC
zkcNPE^%;(Mp{W+oJIZDXWz?xoaOB+6@CFM9%RFa9!$@RkO@W&T>n3hk_T|SaH;*!8
zs~FoD%eZ07Z*U;<P2Dh?%ki~w$-gVBVQ3zm-bMFS!NV+}$8jO@(+49xd!}LHVCF~|
z>%;EJsP}mv&C@a%tE1lNtgByi2SX8$3v&}MZL2XaSj|+o#sel@&MnJi%h=Lw2Y1*!
zF7rY*rD6_?oI;lKrNs)2853;8vBoaRC5dZ%_j*Bm{;>FLlo*@y{_J@it9aMmB{E~I
z7)CgVgb|9!RU*EU<}o*5wup4AnfzsbfSThFEY6o6vSKw?hcqq2$-w!_ffC=5WR0ce
zayx14K`U{Ln9N~hJxTAaISc&AkK!3kuOdv8Evdt*CQckDSC(TnwC>4y`(|HZ2an<c
zH-ixF#=3ld0oZ1Q-r9D3e2s1Aim%7wzl;2OTJR%L=EGKNUm=9p{Q4Xr8HVBhCy%t$
zCM}gfox}$59^CP0(Cy|=?;q7LB?OAxdVGig5WH1emAZzi#TNXOE)L<FbnzG>SwbTO
ze1<(mJN*le6-YkiNLM9z1HTLCK+%p6e49a)BfY4=m$1*r69I22+A9Q|3<fBRps8pz
z1ov66aHPu!W;yV4UWWsfOoju4|H!;V@XH2!nE^i__<qGsfZwun93ZeWz(~$fg=P*_
z*A+IQrwIDF9EW~Q`)Vl~6NGh^F2f#t1=B3AgkWbwatn&@1$~zr`Yv>vLA3;`0LmZ(
zfw$4)8T^<-FE*fyMDPo4EI?gV%9^b32T>}*c2VI&E|!a0X$Qd{NNuQJs|~4u6jeq@
zE~^csm20Jr#Pjt7S(U^<3KWnG0n*mQy;4aqo^CQeD<EyVuqJH_%HbyEPgKqc<^LgE
WBRMBr3c`y`0^z7;B9L+#-~9^$2d`@Y
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/exec-002.js
@@ -0,0 +1,188 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/exec-002.js
+ * ECMA Section: 15.7.5.3
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Test cases provided by rogerl@netscape.com
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/exec-002";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp.prototype.exec(string)";
+
+startTest();
+
+/*
+ * for each test case, verify:
+ * - type of object returned
+ * - length of the returned array
+ * - value of lastIndex
+ * - value of index
+ * - value of input
+ * - value of the array indices
+ */
+
+AddRegExpCases(
+ /(a|d|q|)x/i,
+ "bcaDxqy",
+ 3,
+ ["Dx", "D"] );
+
+AddRegExpCases(
+ /(a|(e|q))(x|y)/,
+ "bcaddxqy",
+ 6,
+ ["qy","q","q","y"] );
+
+
+AddRegExpCases(
+ /a+b+d/,
+ "aabbeeaabbs",
+ 0,
+ null );
+
+AddRegExpCases(
+ /a*b/,
+ "aaadaabaaa",
+ 4,
+ ["aab"] );
+
+AddRegExpCases(
+ /a*b/,
+ "dddb",
+ 3,
+ ["b"] );
+
+AddRegExpCases(
+ /a*b/,
+ "xxx",
+ 0,
+ null );
+
+AddRegExpCases(
+ /x\d\dy/,
+ "abcx45ysss235",
+ 3,
+ ["x45y"] );
+
+AddRegExpCases(
+ /[^abc]def[abc]+/,
+ "abxdefbb",
+ 2,
+ ["xdefbb"] );
+
+AddRegExpCases(
+ /(a*)baa/,
+ "ccdaaabaxaabaa",
+ 9,
+ ["aabaa", "aa"] );
+
+AddRegExpCases(
+ /(a*)baa/,
+ "aabaa",
+ 0,
+ ["aabaa", "aa"] );
+
+AddRegExpCases(
+ /q(a|b)*q/,
+ "xxqababqyy",
+ 2,
+ ["qababq", "b"] );
+
+AddRegExpCases(
+ /(a(.|[^d])c)*/,
+ "adcaxc",
+ 0,
+ ["adcaxc", "axc", "x"] );
+
+AddRegExpCases(
+ /(a*)b\1/,
+ "abaaaxaabaayy",
+ 0,
+ ["aba", "a"] );
+
+AddRegExpCases(
+ /(a*)b\1/,
+ "abaaaxaabaayy",
+ 0,
+ ["aba", "a"] );
+
+AddRegExpCases(
+ /(a*)b\1/,
+ "cccdaaabaxaabaayy",
+ 6,
+ ["aba", "a"] );
+
+AddRegExpCases(
+ /(a*)b\1/,
+ "cccdaaabqxaabaayy",
+ 7,
+ ["b", ""] );
+
+AddRegExpCases(
+ /"(.|[^"\\\\])*"/,
+ 'xx\"makudonarudo\"yy',
+ 2,
+ ["\"makudonarudo\"", "o"] );
+
+ AddRegExpCases(
+ /"(.|[^"\\\\])*"/,
+ "xx\"ma\"yy",
+ 2,
+ ["\"ma\"", "a"] );
+
+ test();
+
+ function AddRegExpCases(
+ regexp, pattern, index, matches_array ) {
+
+// prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+ AddTestCase(
+ regexp + ".exec(" + pattern +").length",
+ matches_array.length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ regexp + ".exec(" + pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ regexp + ".exec(" + pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+ AddTestCase(
+ regexp + ".exec(" + pattern +").toString()",
+ matches_array.toString(),
+ regexp.exec(pattern).toString() );
+/*
+ var limit = matches_array.length > regexp.exec(pattern).length
+ ? matches_array.length
+ : regexp.exec(pattern).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ regexp + ".exec(" + pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+*/
+ }
new file mode 100644
index 0000000000000000000000000000000000000000..d31bfaa840af52f6f504f63562aa365298a95c99
GIT binary patch
literal 1522
zc$|%q|7zn#5XYBA2%#>E3C0Lxgb2nz64&(^a~$p6wX);fIV5hd+)$dk3w!dMBTkmo
z)w-v^{oiNl1N3S75`Bd3+K#2BDV&6)*_rQrW=1odOwT-Y{c7f3T)4Bh!2%)?h`aCp
z)StE{o5P0y_&7^Aq-hXG-Sa>IXQ3x}5G`}RGYlfe?{Y_N#KJH?_I7#G^$K|4=Yd9U
zdV&d9$(n}}wvhO|fsTp={spYw7rU`t&RL;obqb&IlX){;hhgK2@qoP#;RO7Uafyke
z`a@sLd!u-jtOYC{)-Z=*?0-Dk_g|dKanlsIOp-j$j}sV3N3e|45Oc<tAo3CH8HhE{
zhpbFK>}~5b=KBNjd>$mik-ilRFJ*fxkhN3ir(_`|dG*eH^}S}(L*sNE`D)6-z}CHQ
z7%%Rwz4>f1edXob{!0G^A7hs$Oh`&ZI4mJcYVKk&1GVH4OCi<VemNEVW*ej{Cj47S
ztGn+FQ>!o_1D|Y@DoT7$3?W*IThdkWRz-s6kP3x0<*Fgme`DN^;FGgWZ8hCy+ni74
z=VK!qJn3sMUQlm5nooY5(yQ^zli%7_`OPh4U-x=Xw9lU<NiNWQqY~;xmhv>)2dQ9O
zsIvHN<6*epY}0mk(@Lq`-8PG}jY~3dn~X;n?oD5NmpR4McUiM-2#GWlL~CCs+laFp
zJ9We@6OJE8f(4QD8nVD&fFH=cj#Hl{;K8qJh<y2TkB{;5>-lUv&bRW1apY*&F!ZB(
z2P1^h?}k-z2)4)(?rx0^e!Vs7cy8+G8AkGLoY4bR*0H>vs+WN_*Wcgo41`K5SX7$$
zxqQsWmFB;hhw{1n0;W=$c<=?vGklI4xbe7h_+RG#^r@IrjQR-mO4PPWnqDFDzd0Cb
zm`Z~f9h(xJ5TcO^v4~Ad<pD;2VY8w2w3behexOUSt+i0eu9Z(T39Jot4XGOuT$P|x
zS?XR`FPD|#Sy55JKOl?lCDtQ?m&ncq_9KE5q~(HstKwAUhUtD*?Po+ODp_50bx3RF
YH)`(M<qlE6%n-%jR#6Gj>Yj$^KaY2BWB>pF
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/hex-001.js
@@ -0,0 +1,68 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/hex-001.js
+ * ECMA Section: 15.7.3.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ * Positive test cases for constructing a RegExp object
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/hex-001";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp patterns that contain HexicdecimalEscapeSequences";
+
+startTest();
+
+// These examples come from 15.7.1, HexidecimalEscapeSequence
+
+AddRegExpCases( new RegExp("\x41"), "new RegExp('\\x41')", "A", "A", 1, 0, ["A"] );
+AddRegExpCases( new RegExp("\x412"),"new RegExp('\\x412')", "A2", "A2", 1, 0, ["A2"] );
+
+AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x41", "\\x41", 1, 0, ["A"] );
+AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x412", "\\x412", 1, 0, ["A"] );
+AddRegExpCases( new RegExp("^x"), "new RegExp('^x')", "x412", "x412", 1, 0, ["x"]);
+AddRegExpCases( new RegExp("A"), "new RegExp('A')", "A2", "A2", 1, 0, ["A"] );
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, pattern, str_pattern, length, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ str_regexp + ".exec(" + pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").length",
+ length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..cfdc8f885e0ef23c33214ab6caf0c25a076776f1
GIT binary patch
literal 1366
zc${rge{b4I5M8ZSmbJ31$U+Dq4xxxcBq1D4QPu0UrvpNA^a71+l7F};+SnVis()#{
zG(qYYyw7uA;ASz!Tva2Poi}gZyqWcIGW+PE#icu#P6zIt2zac7TL1Qs@uof51doEt
z@k=UsmWd>83`NZ3x&XRYLUGALPe~Ck3%oXBVOWG6PcbF@DUTlZ<qknEfV!ept4Qh+
z9zmjY%cNirAwTDS$Rr3Qar1jDk@SAH3d7zgiPDwg!S}uBFiiZ<^?{V^2mW2I%@_Fb
z7T1z{;}5coOAv?do}Z+=agoS~h1cL9;!u#4CyzVdop0=2dQ($@njOdTd?`{@cez^0
zy^$|gv9IUc8@ac$6mcp1Jy$nr0CfdW`Bptlf^{EUh-Iu*=S(iSDwe(Q=I&&6=@s|>
zlW~hr?35|!6kC!n`Ab@jnDU=^cF*+c>}_OxVbbI;+%G>TNsw~?vz~qs1aqFL5zDyM
z)!B9ppnSO+%qUzqf3ZRyFVz$I@Zmru`KN;;`*!SllTR~ecyl?snGVM;oloXh<BIr_
z$o1)i2tyv&-gq<z5)G2)cx`XgK0S8w4(}S#DpVpAF>gGEY-x>0)4~0jebn9X+Bxf&
z9qF{!dxhVVqs75dH+O`O$jJ$KgfEDE{pw_jNu>ws$B9%=uoKV~dQ_T<ki*ggYITnn
z!CljO-GBXS@71OkRBLp7*EAIr<GXZ!gxorPVnVJd^Aj1<H4nq&`Sbz)1P>Y+OS9Fc
z%VO@1$Hn#hWwh%Amn?eNZZ>R;5Jo>6C7W9KfVN3LKQu@$KQu`<KOB;emVwSOvS|rI
zC?s=o0Z^%JR%dl&8z!<l1}4W9{n{q}+)K1{q6LX-j5-K4saXa94Aemjn{c3|hGSAf
zF)dTWIm75*Ob_u8S3!bU21dAstH`L8opT7$L0?1gLxea8llREj5sw{5GcL9ajn|-!
zroA(fQ89PSislV}z&k_bf>qY6xBu^Vg>XUmqh-@7EXM4j?StPSQ@84&-}`3S`5SAA
V>#f9|%v)p<w}cF2mUe2${14txZ9@P6
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/multiline-001.js
@@ -0,0 +1,68 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/multiline-001.js
+ * ECMA Section:
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Date: 19 February 1999
+ */
+
+var SECTION = "RegExp/multiline-001";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp: multiline flag";
+var BUGNUMBER="343901";
+
+startTest();
+
+var woodpeckers = "ivory-billed\ndowny\nhairy\nacorn\nyellow-bellied sapsucker\n" +
+ "northern flicker\npileated\n";
+
+AddRegExpCases( /.*[y]$/m, woodpeckers, woodpeckers.indexOf("downy"), ["downy"] );
+
+AddRegExpCases( /.*[d]$/m, woodpeckers, woodpeckers.indexOf("ivory-billed"), ["ivory-billed"] );
+
+test();
+
+
+function AddRegExpCases
+( regexp, pattern, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+
+ AddTestCase(
+ regexp.toString() + ".exec(" + pattern +").length",
+ matches_array.length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ regexp.toString() + ".exec(" + pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ regexp + ".exec(" + pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ regexp + ".exec(" + pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..519c05d81a9d144a4cc9c0085aa3c696b0c7db37
GIT binary patch
literal 1174
zc${sL@oU;Z6vvMvgm8o)A|fIZixcf!w4Ic$YqzRRTT8VgvHfA)kTYI2TTHUMbF<K2
z_BZTr*x$B)V;56RJC=~+-Fu(+eed0+(;Hma;P%XF_xo+@vpXR^clrI>7qU_9tu}Wq
zq2@BAgfTbpjZ2pkiancC*PkYSz2o|r-Y1Si7kgf^t=k-P*Xfh__^I5MNSg?uq*Nsd
zMk!=20%$Z?cwYGiQx}gtazY#rQ_KTe`PU_~wjVo;QWCA)>B4uSa3`4DuZOTmG(iHX
zwnN>JqmCCiU-i>~&awAF$j*ttncilMP);VIsO<zH$@cCxEf(99;wR%bH(ksLb)6(o
zv<P3&WVZTRbyH}iU0L`0WU^a(X!QnXc5+L9qyc=XQZgmWPzx~^*?yLBI(oD-ksXKg
zbIhF?VIv$hs*ojdR3loe+4f{IB#d`4Bl34lk+>4FEC_FWK9Qekw%Hx_t_En>8(x~y
z(UIyAf68atjcM7!pW;FMOQbv3XM^j0$F!t}2Utqgj2M*9dnHADC9P34YM*u*X~r?-
zQDN2W_S>UfFplf#kIgfk&oI}Wz~|WY^(%*C&twh`iA}yOi0=?4S`8N*tpqD^b|Z+m
zSIy>*@r7wMV>OIaDk)r4%GHc@pVivO8Ry|aqrt>^FIZ!|n6l8ryuoI{kCE6J&eVPH
zPL5u;_IBRv!P-hpl)D{TrkUKqZz-=!FpHFOF0VrXAowYz(rFc@P!7I}4IQ>(BM<ju
zqYTeg8SFwJ)@)179qz#<G+?~~;^(-GB-nvf5k7&S4#2jiW`s*tL<tRLi+L46q#y~&
zD1(reh2R%NTT(?T$O?d}41tu93IJsa+KD7oQY~2m(F-8dfDA7H+JIF}i-^NDp{$5)
o1)!p`fr=5b{~S36nFPrE2e<@M0vtrZ`E%e@M9~%ma)OE7UzGYiCjbBd
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/octal-001.js
@@ -0,0 +1,78 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/octal-001.js
+ * ECMA Section: 15.7.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ * Simple test cases for matching OctalEscapeSequences.
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/octal-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp patterns that contain OctalEscapeSequences";
+var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346196";
+
+startTest();
+
+
+// backreference
+AddRegExpCases(
+ /(.)\1/,
+ "/(.)\\1/",
+ "HI!!",
+ "HI!",
+ 2,
+ ["!!", "!"] );
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, pattern, str_pattern, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + str_pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").length",
+ matches_array.length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").toString()",
+ matches_array.toString(),
+ regexp.exec(pattern).toString() );
+/*
+ var limit = matches_array.length > regexp.exec(pattern).length
+ ? matches_array.length
+ : regexp.exec(pattern).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+*/
+}
new file mode 100644
index 0000000000000000000000000000000000000000..9b436cf0a5f98a8d78f5fdb260bdc9f995400ec2
GIT binary patch
literal 1509
zc$|Hb4{zEy6u>PjiXtnDDufV<Dil>c1RNK*URBXvyA9g3V=AmlShZ_+#~I^6ZXwBR
zv$fLpDfT(`9nT>^=+rfiV!!u(@1I{f-To^N++MitUa#%`?T=|Fd~yHhFRE={`hqeX
zc!K%i#JP(Z<=l_LN_PRh_bJPi+ow1PGSTYzA!hfPqV5SSeA1({(Wcvu<i;|37P6cf
z6Bjy@1~lx?gP?qknU6;SJ)<PROoofX-5+%kE43NJ8<|&axHRb@(>Is;{(MH6PclPo
zZP@In-sYS#LC04z&5TOIBT-DP^N7uGuvT(w#mUMRMDctclBCv7G`>fjAR-@1E){c@
z^{0D;`LQT;->+5WmDfhIx8A_*_Ak6_O5e4A;ja)IF%~j+s53gDcQG6lxM0Jj5)yNU
z1({Ml#L3NQ^p28z0;IHVCyL5;dpu6B=oE9x3sM|VE)oIB8PPlS6J|gUXgCqmBF3W;
zA?ep#3s`Q3=bR3@ulrjfN`IVO=gmd`O|Rp)%E<{DbO)D?aqYOCWJ)VfxyhaA&S|eb
z+#98JSjz^uC8k(dBnk!gL+dpWIB+<@G4<%jISmQr2aSqdee`|TDyPvJQR4Sov$<#g
z$MadquzLJc=Y{{xREYSf(cp5JbKV%uCp-?YXz*$Dc_<~DO#J8m_~eiMgWp?+IW900
z$;~NWz8F>8597IbqP)YSr;;D;|GX|u$RubH|H&Awtl804)lLVvs7wyEShZJks#J69
zaoi4E$H{)PuWH3oU;$~hvfYFLK=7BE-`dt;4wb=CdT4_E^k9R7^iTsGU4ds1$Zz3F
zFZ4^G1@^#R5iFm4IS2lc!64A&(&dup1Rm&x%My46cEC;s*Ye={M;K^Jd{6=}z%JN*
zfFD1KUqMg@VB645Ls3yqwqu||$<&b)kb)30kzwpW@C~Axdal+L4XRrzgo>%wp<(VC
zXNrtc+*ehQEU1D!MBo`T)?nE%65@D8<QBwR4H}lVhO7i>Jw$GxnE~b_z)PrPfSUj>
P9|G^B)u=$Qfl29qn|XS_
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/octal-002.js
@@ -0,0 +1,93 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/octal-002.js
+ * ECMA Section: 15.7.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ * Simple test cases for matching OctalEscapeSequences.
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/octal-002.js";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp patterns that contain OctalEscapeSequences";
+var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346189";
+
+startTest();
+
+// backreference
+AddRegExpCases(
+ /(.)(.)(.)(.)(.)(.)(.)(.)\8/,
+ "/(.)(.)(.)(.)(.)(.)(.)(.)\\8",
+ "aabbccaaabbbccc",
+ "aabbccaaabbbccc",
+ 0,
+ ["aabbccaaa", "a", "a", "b", "b", "c", "c", "a", "a"] );
+
+AddRegExpCases(
+ /(.)(.)(.)(.)(.)(.)(.)(.)(.)\9/,
+ "/(.)(.)(.)(.)(.)(.)(.)(.)\\9",
+ "aabbccaabbcc",
+ "aabbccaabbcc",
+ 0,
+ ["aabbccaabb", "a", "a", "b", "b", "c", "c", "a", "a", "b"] );
+
+AddRegExpCases(
+ /(.)(.)(.)(.)(.)(.)(.)(.)(.)\8/,
+ "/(.)(.)(.)(.)(.)(.)(.)(.)(.)\\8",
+ "aabbccaababcc",
+ "aabbccaababcc",
+ 0,
+ ["aabbccaaba", "a", "a", "b", "b", "c", "c", "a", "a", "b"] );
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, pattern, str_pattern, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + str_pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").length",
+ matches_array.length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").toString()",
+ matches_array.toString(),
+ regexp.exec(pattern).toString() );
+/*
+ var limit = matches_array.length > regexp.exec(pattern).length
+ ? matches_array.length
+ : regexp.exec(pattern).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+*/
+}
new file mode 100644
index 0000000000000000000000000000000000000000..f1c625aae930d86a84eff8dba60622118ab01676
GIT binary patch
literal 1473
zc${5Q|8C+&5MHgUm1S8LLI_z1AuEaykkpU_MW<_WS0E%M3f##iQI*`4Zp;SUGdA5_
z+C;k7>7(=!`Vf7K&hpD7`~f>N-+bRUGqihyYacyad98lG<$VpuES8~s`SD+JTInr=
zr;zdP^PDpw!X$RuVNCf;nkaT?6s4hi6H3Nu<VzmLlQe(mODe;l&t{LibbCNI24E^x
zPK&CA&7e@eqdcUK5xZbPL^%*8@&4Of!i~{j5k-x)gTZ3Pco?K~wQXV7u+tKPammKO
z=LgB08SN+uzBM|@Y`%c>TgSCd0*;jfy32AqAA{L6(FEFX5-ayZ$|p>w6WW)HI8X%b
zWc-rvJ*8uA3Oi$#JSG=BU4?y_@NICo@%|amGX~QwCouhhhjZxwbVj3XO>A!CF?E>K
z>w`b^dV?!Jy?&4Uh7U~6ChU1`&8dX8SZB{HD9oq~rc8_|=kz5nBp<EIIrUz5tU>wK
zcsyi6cBo)x#NvsZl0PXoUBy%};PUL*WFnxj^eCK#vIq?;bE-vHez!C1eHvtBvidt&
zcU{kiM7Di<HMs4!yPh%Z4R5;I`8ocYsk$o-tLla^+)k@L*iSr}b*7Yek}<<oW0^;0
z{Y&HMsE*IH@86eT@KIjr){{We=!Zt*#Qj~ED^<f)aQs0#I<l+o#!IF8xN33M3lNT+
zQt1RqENK`!pA=DdIh@b_Sg<%?A}b{2Qmw@7cKWT+u|XB}{Zz{N`+8l#@fM=~xR{7}
zL}gt}lfOm~xxpm-7>>_Rnx{u6$Czpd2f753hoRT)rbqjaG;9r*4881B_Ax>j{X;TV
z&cqqRAs4I1J{hha74muYD3f1I4S5*BcWG!ge|}HSF!YjpO-Gl_9L}Njhuo06ZIB1}
zuNYMjaxK%=HEft5X+xh@wBTiwjtiy%Swk}n!#4CRSo&MD%J?T-17=JJMp_=%ke)AO
zFEpUbG>H;c&Pg5_<P_;!U@e<fh_emCTq0Z@>Dd&tguHtVX(KxY*a~p-8qm;CLDk^L
z#wqljf_kr^1E}hIP(+0i)>15_tlTy1vRJ~`Z!EnD53O7QfYx@8_ye*~(LrDKtU~q)
aE7kk8>W=a;vdCc(>Bs`@0xoU|k@Y`w%zB{!
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/octal-003.js
@@ -0,0 +1,87 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/octal-003.js
+ * ECMA Section: 15.7.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ * Simple test cases for matching OctalEscapeSequences.
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ *
+ * Revised: 02 August 2002
+ * Author: pschwartau@netscape.com
+ *
+ * WHY: the original test expected the regexp /.\011/
+ * to match 'a' + String.fromCharCode(0) + '11'
+ *
+ * This is incorrect: the string is a 4-character string consisting of
+ * the characters <'a'>, <nul>, <'1'>, <'1'>. By contrast, the \011 in the
+ * regexp should be parsed as a single token: it is the octal escape sequence
+ * for the horizontal tab character '\t' === '\u0009' === '\x09' === '\011'.
+ *
+ * So the regexp consists of 2 characters: <any-character>, <'\t'>.
+ * There is no match between the regexp and the string.
+ *
+ * See the testcase ecma_3/RegExp/octal-002.js for an elaboration.
+ *
+ */
+var SECTION = "RegExp/octal-003.js";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp patterns that contain OctalEscapeSequences";
+var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346132";
+
+startTest();
+
+AddRegExpCases( /.\011/, "/\\011/", "a" + String.fromCharCode(0) + "11", "a\\011", 0, null );
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, pattern, str_pattern, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(pattern) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + str_pattern +")",
+ matches_array,
+ regexp.exec(pattern) );
+
+ return;
+ }
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").length",
+ matches_array.length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").input",
+ escape(pattern),
+ escape(regexp.exec(pattern).input) );
+
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +").toString()",
+ matches_array.toString(),
+ escape(regexp.exec(pattern).toString()) );
+
+ var limit = matches_array.length > regexp.exec(pattern).length
+ ? matches_array.length
+ : regexp.exec(pattern).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
+ matches_array[matches],
+ escape(regexp.exec(pattern)[matches]) );
+ }
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..fb86f979eec076fdbfc82ce1b2e233341e9abe65
GIT binary patch
literal 1767
zc${^Ti*DLT6ox0(2w9fpjVy!^LXj0AL@2mUlyuvav;{&EqQFL&MpZHCI%c5L^#zTG
z7J7NmeVZL$z*b>x$v*Rc=Qd}i)$QNvV01lb_Il017*CK(F<rg>BU7z(!^IRM(pk<4
z@_p>N+8w5dn0CwaY-G9#P-CD|g56o77u%+7C(CkT>eQsjVI^vTg{>ZPp3<e17Isat
zN`yluOjz=yuXQ*5g@XvTw!0aipp`@~J(vWWPd2(lmTeM~dZhfj#N4WFk5vjRGu6A&
z^nFAqny?7n^5#hR)L+<k{%YY`fp5#3tjg;}DqC$Gch3X|vBtt^<;o+DX>UZo&_~~r
zYNBotJf|alIOz7T_2g*&<(H5k?pd)pnMC_*n?CY$Y&k?e4Hjaga}I~OnLH;R_2_Dj
zI3HeIWWJgN@RWIS_CEEZ^Wt>TSZLbWv7~p}!|q>wX=F^sKhA#fhW6@DIK%2=Wn|XB
zkE=(cN8_8}8&ktI$oQGC{JHx1ov*w-Kaw6g1D%DIM#km%$8qiK*T_)n;~-H!h;7zC
zYV}v+Dvy@P;-2R$&-E!;SnLcW%X8+~Mo_K7nIn!2ef+j0x87g(-}hRbfiUb2?>fA(
zJUx@0g-x-IU6fUA)2Cf`f|io%dkbQr2bJZFQz{o1N;Cy^vwt;JQue7yXfQB&lLula
zr>;j*ITE9+nHhE(YA~>!IRhYe+P&tdlZF~>ZKqcN8ux@9JE0i)iZ_jYlrC$@bS>oH
zZA$O16T=%d9@hWtFl1Rgb3KBByO2{8TZ{ak&o_<KHSJja;)^redopcFjs976Gv?87
z(CH+X?;oL3fE*O~tJ2L02LK1Ig;Fjja#^Va=aF#&pCaQ1P9x(A=J^a5a)5oIDwYAy
z0jO~xc=tj41gt8`@AB~7Zc>(DncLe%E=73B^u29T6JRaOw)Z<Zt-@0lu_NY13%&^J
zY{jULPz__Y$l(Wg7<RBlZd>qnceY9uR<=7Ra6kdzP!c7vC;*wwm?@A`m?6PZL6m?b
zOA^C^R4g8_`G>R3R5K#;fPZs)Vpd==f&lpaLW+Ej$w5dCQe+U5Mo1bd@+Bs3Lh>d>
zCNX&#l9vG~MC2aGOgD1596NX=4`d)iE#T9Le-yd(3(tW9&+}|w63pj;2*uzhKmq16
jL8sw;S?8rdVj4*)E)bbwr<AXNwFB-_N*}Nxf`|VA>6@gm
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/properties-001.js
@@ -0,0 +1,91 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/properties-001.js
+ * ECMA Section: 15.7.6.js
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/properties-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "Properties of RegExp Instances";
+var BUGNUMBER ="";
+
+startTest();
+
+AddRegExpCases( new RegExp, "(?:)", false, false, false, 0 );
+AddRegExpCases( /.*/, ".*", false, false, false, 0 );
+AddRegExpCases( /[\d]{5}/g, "[\\d]{5}", true, false, false, 0 );
+AddRegExpCases( /[\S]?$/i, "[\\S]?$", false, true, false, 0 );
+AddRegExpCases( /^([a-z]*)[^\w\s\f\n\r]+/m, "^([a-z]*)[^\\w\\s\\f\\n\\r]+", false, false, true, 0 );
+AddRegExpCases( /[\D]{1,5}[\ -][\d]/gi, "[\\D]{1,5}[\\ -][\\d]", true, true, false, 0 );
+AddRegExpCases( /[a-zA-Z0-9]*/gm, "[a-zA-Z0-9]*", true, false, true, 0 );
+AddRegExpCases( /x|y|z/gim, "x|y|z", true, true, true, 0 );
+
+AddRegExpCases( /\u0051/im, "\\u0051", false, true, true, 0 );
+AddRegExpCases( /\x45/gm, "\\x45", true, false, true, 0 );
+AddRegExpCases( /\097/gi, "\\097", true, true, false, 0 );
+
+test();
+
+function AddRegExpCases( re, s, g, i, m, l ) {
+
+ AddTestCase( re + ".test == RegExp.prototype.test",
+ true,
+ re.test == RegExp.prototype.test );
+
+ AddTestCase( re + ".toString == RegExp.prototype.toString",
+ true,
+ re.toString == RegExp.prototype.toString );
+
+ AddTestCase( re + ".contructor == RegExp.prototype.constructor",
+ true,
+ re.constructor == RegExp.prototype.constructor );
+
+ AddTestCase( re + ".compile == RegExp.prototype.compile",
+ true,
+ re.compile == RegExp.prototype.compile );
+
+ AddTestCase( re + ".exec == RegExp.prototype.exec",
+ true,
+ re.exec == RegExp.prototype.exec );
+
+ // properties
+
+ AddTestCase( re + ".source",
+ s,
+ re.source );
+
+/*
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=225550 changed
+ * the behavior of toString() and toSource() on empty regexps.
+ * So branch if |s| is the empty string -
+ */
+ var S = s? s : '(?:)';
+
+ AddTestCase( re + ".toString()",
+ "/" + S +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
+ re.toString() );
+
+ AddTestCase( re + ".global",
+ g,
+ re.global );
+
+ AddTestCase( re + ".ignoreCase",
+ i,
+ re.ignoreCase );
+
+ AddTestCase( re + ".multiline",
+ m,
+ re.multiline);
+
+ AddTestCase( re + ".lastIndex",
+ l,
+ re.lastIndex );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..f33acc8faeb5bac69c7600ad9276685c09205e04
GIT binary patch
literal 2377
zc$|$??QY^m6rETIS=Pw1M#!?FC_+($D9d_TLbGg22%kxafJQ*jYD1HC%!KvI*l0ZL
zCjC-XRsC1>VfrwAjXpwWu#M?%XadqObI!fz+<Rw4t<^p2gUgd%wbQBgzO%;Ip%%UW
z=8w3ZZY>VC7ADQR8Nr@sxlXQaQA`ZGJD*}=nGunSwtZ?)JY~6Cb;GtJJj)5o?BMCm
zLy|SuwXxwugdPxmN-Sp*;mMli800<z(pB~|akym!?y#sa%Zs`Q^?I0#MUlnTx+1B8
zK_-|MJ_jPb)X*T7abx2KHf@724cFQI9CJyg?y^ESX{-!Gy6(<xTRWaRCZ}rd_#XC6
zV$EohIbuTbm`U|bcZQS4E}0tkIg^`W)`6D_vsR3=Vb(Hik$c%6^jh7Mesr^ci@(PR
z7M_V6gT9Z?+)uGlZL2yS`%|eK9`;mr9AJ;~1F{W|wwy7(1HwdjE?B}8&4^1~dOyR^
zPl_EL#y=WF@I->Ii+tJV%WIJ`5xy(%<)uPh|0?<E6<_jv`I;|#f-UiwoHEM%kjoZx
zKgp&$omn<UwTqMPMW@#6#YdkqLMC>l3ooQWYtU|rBeQy>ny%wfGB??%<zcheZ++Vp
z@f|khezQJc2h^#)xgJ*A7fr}sExTe>4+}|uRnmEA^6)U}x1uk5TM+SyHEl1$9}Ejg
z_%dJE+k0I)Cv5D5TG&gvw?TNa#Y!|B6MLt6(AI-m0S70xdt=xMeLA<PWm^u;`Jpdn
zOY!HqTwed+LC>8N6RSFVqb|Yx#uEDS%7#qQ31+j#a5=k@&Ts4C78xPyz7ty3gjh?2
z@^=E8^-lFVFY7_wQ7xB)Ub7j!y}!_IDkeyhSR1x`0ssQ|6P;})p|FL9(D64t_=~@3
z!&`q-gX35n{49W&qUnh)iYY44<+uo9ai#|RPbJtKRamTa3V{y0(uM>ius%@H3W<iw
z<qEQ#SQA$XH~$=Q<tqpZu)%bh_LFiHt(Yil+@!eP<md~NA}sUbrHv=$C|Wjg`i`4q
z*PE2TFv-GG*2l*Gn3VrxvY!wYZnD2_`sHx?`%qkzzi#?vKK)c6ms%%R3FT6c$W^#p
zK9I}Hvhd`~%!kTP%2Bl4z+_jJj~`0_mB3_oY4VgDMN0=J>2-r?go8;xGMEOJD+O{T
zSp;w2@XT!pN?~SzWdx7`?D;^X9%x{P<tLGp-h>FC9fXjIG<1+;@Uxi8qG2X3vk-X4
z-p;lNKt>e7)@Ejfxe1uug2}Bg9|Pum!JMx!?*pc?U@9xjRlp1u%z!hSKJz`;Vfc(A
zw>~nGh42f{zz#gy1_&akYy%al{6~WtRN}lg_MZ|d{R$AnKCB=Fs0{gS1+js~kRMkN
J3Jw?|{|k5M>Tdu5
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/properties-002.js
@@ -0,0 +1,129 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/properties-002.js
+ * ECMA Section: 15.7.6.js
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+//-----------------------------------------------------------------------------
+var SECTION = "RegExp/properties-002.js";
+var VERSION = "ECMA_2";
+var TITLE = "Properties of RegExp Instances";
+var BUGNUMBER ="124339";
+
+startTest();
+
+re_1 = /\cA?/g;
+re_1.lastIndex = Math.pow(2,31);
+AddRegExpCases( re_1, "\\cA?", true, false, false, Math.pow(2,31) );
+
+re_2 = /\w*/i;
+re_2.lastIndex = Math.pow(2,32) -1;
+AddRegExpCases( re_2, "\\w*", false, true, false, Math.pow(2,32)-1 );
+
+re_3 = /\*{0,80}/m;
+re_3.lastIndex = Math.pow(2,31) -1;
+AddRegExpCases( re_3, "\\*{0,80}", false, false, true, Math.pow(2,31) -1 );
+
+re_4 = /^./gim;
+re_4.lastIndex = Math.pow(2,30) -1;
+AddRegExpCases( re_4, "^.", true, true, true, Math.pow(2,30) -1 );
+
+re_5 = /\B/;
+re_5.lastIndex = Math.pow(2,30);
+AddRegExpCases( re_5, "\\B", false, false, false, Math.pow(2,30) );
+
+/*
+ * Brendan: "need to test cases Math.pow(2,32) and greater to see
+ * whether they round-trip." Reason: thanks to the work done in
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, lastIndex
+ * is now stored as a double instead of a uint32_t (unsigned integer).
+ *
+ * Note 2^32 -1 is the upper bound for uint32's, but doubles can go
+ * all the way up to Number.MAX_VALUE. So that's why we need cases
+ * between those two numbers.
+ *
+ */
+re_6 = /\B/;
+re_6.lastIndex = Math.pow(2,32);
+AddRegExpCases( re_6, "\\B", false, false, false, Math.pow(2,32) );
+
+re_7 = /\B/;
+re_7.lastIndex = Math.pow(2,32) + 1;
+AddRegExpCases( re_7, "\\B", false, false, false, Math.pow(2,32) + 1 );
+
+re_8 = /\B/;
+re_8.lastIndex = Math.pow(2,32) * 2;
+AddRegExpCases( re_8, "\\B", false, false, false, Math.pow(2,32) * 2 );
+
+re_9 = /\B/;
+re_9.lastIndex = Math.pow(2,40);
+AddRegExpCases( re_9, "\\B", false, false, false, Math.pow(2,40) );
+
+re_10 = /\B/;
+re_10.lastIndex = Number.MAX_VALUE;
+AddRegExpCases( re_10, "\\B", false, false, false, Number.MAX_VALUE );
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+function AddRegExpCases( re, s, g, i, m, l ){
+
+ AddTestCase( re + ".test == RegExp.prototype.test",
+ true,
+ re.test == RegExp.prototype.test );
+
+ AddTestCase( re + ".toString == RegExp.prototype.toString",
+ true,
+ re.toString == RegExp.prototype.toString );
+
+ AddTestCase( re + ".contructor == RegExp.prototype.constructor",
+ true,
+ re.constructor == RegExp.prototype.constructor );
+
+ AddTestCase( re + ".compile == RegExp.prototype.compile",
+ true,
+ re.compile == RegExp.prototype.compile );
+
+ AddTestCase( re + ".exec == RegExp.prototype.exec",
+ true,
+ re.exec == RegExp.prototype.exec );
+
+ // properties
+
+ AddTestCase( re + ".source",
+ s,
+ re.source );
+
+ AddTestCase( re + ".toString()",
+ "/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
+ re.toString() );
+
+ AddTestCase( re + ".global",
+ g,
+ re.global );
+
+ AddTestCase( re + ".ignoreCase",
+ i,
+ re.ignoreCase );
+
+ AddTestCase( re + ".multiline",
+ m,
+ re.multiline);
+
+ AddTestCase( re + ".lastIndex",
+ l,
+ re.lastIndex );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..04771d4ff185fa063215600aee4b2a6fd26e92f9
GIT binary patch
literal 1552
zc${rhQE%Ev5Z<g-KFhK!3t0#u3+*9<XpSJ7<f4=&ZGn)KD$oj?yr8Js;0^WF*w%VU
zimH3Pm;0Ufem~*HfH6&v2iTo&=9}-ESvvjUhcTL5joO1jdvxcyJdmDTzWztOsP$Ku
z2ak*1w@C0f_QIfX?MW_}KbFD^W?7teynu;i7AQl&g_Mk>nt@}<B%cFNxn;s*_ddVi
zQ=bVYL!o^hE_}cG9Du5NQszwue15+x$?h`W&#ujl!cG|aoCO(B9P+2^rgi*q`nA~&
z=g~rP_c>{;4L`FW(fBj<a53k?o9?)WY%YKXRF9`&#H*XkPXaDNE{AN+Pj}^K^bQj<
zE{~rFcII}u2&Reuolz7nm}DtAy$r=1dI2`)&^FHZAGQ-Nq}83!UDi{b+uW5}eLNLj
zBr7Sp8qEqh`*A+cMV4-UT)N$xM{>FCO+ViM!KXU|v_WY<+rI65@!|}fjGa+`cs0&m
z;or(F{!Mvg!Wj3uPXFUD&s;aPjRlU>0Bm5cMl6o4nZsi_WigL+p9eGf1xwB8JJ&t!
zk@*X5CGdzRk5-e=xRLAJTn%pqo!$r^7`MIA7#gS?a?K>O3q<<S(W~R;5vKG>z(U`1
z=5pbL*Wv6^&~qB_C%PuAy?9OeCejvyEt9}WlrD(*0!o*Z2g%C;_ijz_8UGd?Y$FHF
z=F7hxLP2XZqFz7+eL=rdKH-hEmpfqpPE*EKRHrLbEisAi=%3Jilb4Gn6EZQN_qv1j
z=fm3nbbm|E&&`xeeGENUTd8)yP5Pu03YrM&ZOY)!OgFRlc&vaP^6R;kZlgt2nKVr{
z!Cf6X#$lkZr!#Rzy<WD}-<4yk5L+<~N(vQ2%@a)aF#1I)8Cb`fLh$kWP{FPBp@1*f
z2a5OA96H4az8iT=5J8CGIw}}A2e6t)4o2&<kw+KlIiE*1M(?T`QVaTssP-u`Ok`MZ
zY_eZ|hqV22v4~WpsW}tn6_X%sbv*;VT3tniAl$?!CA9e@r66F4Q4JwoSL`}QdJ`iP
zt9GTMAO*sQ3ek%g?NJN@O@fs@MX75<(UoG7dVtlnBhx|+@*#(+2Drf`q_;ZTJ_X$X
z#;R%U6;3b$vV9C~tEH9ibvAx)p+seQr4nM-5IeI#V}ragizr9RCdyeG%75Q}vViq4
L(fKnr!iV~QWP!VC
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/regexp-enumerate-001.js
@@ -0,0 +1,88 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: regexp-enumerate-001.js
+ ECMA V2 Section:
+ Description: Regression Test.
+
+ If instance Native Object have properties that are enumerable,
+ JavaScript enumerated through the properties twice. This only
+ happened if objects had been instantiated, but their properties
+ had not been enumerated. ie, the object inherited properties
+ from its prototype that are enumerated.
+
+ In the core JavaScript, this is only a problem with RegExp
+ objects, since the inherited properties of most core JavaScript
+ objects are not enumerated.
+
+ Author: christine@netscape.com, pschwartau@netscape.com
+ Date: 12 November 1997
+ Modified: 14 July 2002
+ Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155291
+ ECMA-262 Ed.3 Sections 15.10.7.1 through 15.10.7.5
+ RegExp properties should be DontEnum
+ *
+ */
+// onerror = err;
+
+var SECTION = "regexp-enumerate-001";
+var VERSION = "ECMA_2";
+var TITLE = "Regression Test for Enumerating Properties";
+
+var BUGNUMBER="339403";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+/*
+ * This test expects RegExp instances to have four enumerated properties:
+ * source, global, ignoreCase, and lastIndex
+ *
+ * 99.01.25: now they also have a multiLine instance property.
+ *
+ */
+
+
+var r = new RegExp();
+
+var e = new Array();
+
+var t = new TestRegExp();
+
+for ( p in r ) { e[e.length] = { property:p, value:r[p] }; t.addProperty( p, r[p]) };
+
+new TestCase( SECTION,
+ "r = new RegExp(); e = new Array(); "+
+ "for ( p in r ) { e[e.length] = { property:p, value:r[p] }; e.length",
+ 0,
+ e.length );
+
+test();
+
+function TestRegExp() {
+ this.addProperty = addProperty;
+}
+function addProperty(name, value) {
+ var pass = false;
+
+ if ( eval("this."+name) != void 0 ) {
+ pass = true;
+ } else {
+ eval( "this."+ name+" = "+ false );
+ }
+
+ new TestCase( SECTION,
+ "Property: " + name +" already enumerated?",
+ false,
+ pass );
+
+ if ( gTestcases[ gTestcases.length-1].passed == false ) {
+ gTestcases[gTestcases.length-1].reason = "property already enumerated";
+
+ }
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..6d54de628fd158644936fb431255387c68791658
GIT binary patch
literal 977
zc${5Q|7zM$6h2%+2q6RsA|fIeDb}{mTIssc4Tie3SgIRI+JB_THM!Gl`Nhq3DD;)~
z0(*<S$@T`jF>NCaB%Jfz?|k1m=Vmyb-q<j^wg!{Qz<TgK8gZX*KTx^X9`BNGK4s=6
zVKhzsIO^W|oH7#FocYnRz?(xq@&r=UV1W>}EhzO734$VR-4o`MML<7OHz15~fgQZY
zV%91uY)&{0g?=ZCe0M^_#eQ$SQ5+^~PQBL$c#x))i31^TyKzE$Pg6|SA!WW>FxB~V
z9R&C)W+4f_iVi|5h-v3p;04;rGzN^3y$P$L?xjh5mv|!FKV3&|Hsvt(w$FRCXtu<?
ztvr+VwsJ1q{biJiI)p7LFP5y?F7p$v4ujbJF|!?OJiWGyTl|ME^^kCPMN@Pl|0GOf
zbV)af7SL$PSLKwmd5+YcXmgT{R3CU=-r0zxGzDXLcRjtE3{6Y7&5<+yGF6?ib8G7N
zre%w)BKQtXdB&F7Sm7dWoRY`K#c7vrsM|g~Ji5KHaqfjl<gViE|H0yJXqfOV-r3{D
zda0SC$za}B`e$$7p^pYW>gK%~DJP6)Cg`D=_jbCXn>W4QS@(OYWL`>UC7qne_-HnB
zEYmC&@dtIv64F)0C|9Zo0KqR*QY8&(QW^E~po$Lipn{rtV4#++KnH>N>KBSqYV}L!
zGD0PUE3kY1erja7IBy_m1JqST(PULPlo3cs_<*F>3`LS9RZ=9adVt`!B<Qu4EF)1`
x2NfNcKvuFBt5Qwa!jm|FEF?>yDNVRIhHmu=WtEq^%9rZ*Vw$c28h`;Zz<=}38u0)C
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/regress-001.js
@@ -0,0 +1,45 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/regress-001.js
+ * ECMA Section: N/A
+ * Description: Regression test case:
+ * JS regexp anchoring on empty match bug
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=2157
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/hex-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "JS regexp anchoring on empty match bug";
+var BUGNUMBER = "2157";
+
+startTest();
+
+AddRegExpCases( /a||b/.exec(''),
+ "/a||b/.exec('')",
+ 1,
+ [''] );
+
+test();
+
+function AddRegExpCases( regexp, str_regexp, length, matches_array ) {
+
+ AddTestCase(
+ "( " + str_regexp + " ).length",
+ regexp.length,
+ regexp.length );
+
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ "( " + str_regexp + " )[" + matches +"]",
+ matches_array[matches],
+ regexp[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..216200014b232c45d86fcc3e82df3ecd6c4ca38d
GIT binary patch
literal 1414
zc$}4y@oU;Z6vvN82q7FnL_|a+ND;NpsFYE*vMpNMS*k0>^%pzj8n0=#80B(qmi-a?
z3-&+mPuRtz#uZzbLh|z7_kHgB-gWxJ3kyxoN9JH)j=s1v>T{Pryrpupap`i(h-Y!;
z`c7}XWHboeg<t7!M0YM_NwUx-o|k+!<KE$FPMK>b1-;|?ggqpQauQmca5@+4k`T?r
znaM$qUPd%DlC%^}#>ft>9x_~eK<Br+?hdXAbIGkoPpRz@M)-o2pQeONoeo!?r<*}Q
z8K*O$u<XT>HoJ@YawQT^vE{RsZ-<RL3~brVU2^^NawewParQ{P62dtZ(`?vk$6MIn
z^s@z<6K`7za*yQBV)k$(T3yEvH!~*8p*-13PBd=UHnGN|{_xyNZt<5ihC|707tGl#
zT3wd}GyoH6bHeR=8fZ(x#eqI%)S>HTHsEX;r!rw2rLjkShu>!fW=sPfLgep+X?laM
zsa;XRXFeuQNq8lyxIwzsZdT3aQL8N*rlE?k<!INvk=6e+#8E}Fdfl=3RLA}CWiM^S
zdSg>=If5b<UyH08E8n#jGx|zY8eaqH@Gw<vM8@C*_qqdf+E%!*ckI(2del?V<6-Lh
zokyHNucqQN46WMO&^K@46~08JmSafONjl(!@o-qhFx$ptJnHq5z5Z78yabXW*Bcc;
z2+&WZkj-Jp;5vF81r_uz3L2=RN^k{8Jf)7N)f9A!WF*UI^ZWBY4iHMofaF+JQczQH
zVZRFgOVw7;B`TxxepNYE$qG6UzG^S~+Nc1PURHsEM$fC@U)D43L)HgCMT8Dgnw}|Q
zEtM9#&I6J_6#<qiMGb2>jWJH)4AyZmR|DjLA{w*D0v`S$Ejm)@4P??%8nl88fHQjp
zA3;w9`X0d<;6!lL$ma6mZq==0<pk6;6f-4sTvyAvn{dYLRgBod3_(Q~1t@}A*wR4#
E3oJE8f&c&j
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/RegExp/unicode-001.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/unicode-001.js
+ * ECMA Section: 15.7.3.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ * Positive test cases for constructing a RegExp object
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/unicode-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "new RegExp( pattern, flags )";
+
+startTest();
+
+// These examples come from 15.7.1, UnicodeEscapeSequence
+
+AddRegExpCases( /\u0041/, "/\\u0041/", "A", "A", 1, 0, ["A"] );
+AddRegExpCases( /\u00412/, "/\\u00412/", "A2", "A2", 1, 0, ["A2"] );
+AddRegExpCases( /\u00412/, "/\\u00412/", "A2", "A2", 1, 0, ["A2"] );
+AddRegExpCases( /\u001g/, "/\\u001g/", "u001g", "u001g", 1, 0, ["u001g"] );
+
+AddRegExpCases( /A/, "/A/", "\u0041", "\\u0041", 1, 0, ["A"] );
+AddRegExpCases( /A/, "/A/", "\u00412", "\\u00412", 1, 0, ["A"] );
+AddRegExpCases( /A2/, "/A2/", "\u00412", "\\u00412", 1, 0, ["A2"]);
+AddRegExpCases( /A/, "/A/", "A2", "A2", 1, 0, ["A"] );
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, pattern, str_pattern, length, index, matches_array ) {
+
+ AddTestCase(
+ str_regexp + " .exec(" + str_pattern +").length",
+ length,
+ regexp.exec(pattern).length );
+
+ AddTestCase(
+ str_regexp + " .exec(" + str_pattern +").index",
+ index,
+ regexp.exec(pattern).index );
+
+ AddTestCase(
+ str_regexp + " .exec(" + str_pattern +").input",
+ pattern,
+ regexp.exec(pattern).input );
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ str_regexp + " .exec(" + str_pattern +")[" + matches +"]",
+ matches_array[matches],
+ regexp.exec(pattern)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..fb06246b990cb3d4be09e73fd4ef2eda84287220
GIT binary patch
literal 963
zc${rgU27Ua6di_PSeC_#h)56_M8v8Qk-jyMs@bF#V~e{<3sS;lcdA3i9hn_#^4fpU
z-`SV^gpToJV(AVn_uO;tz30wue>naWfa%qwcYWQPeCIJsG}lk>A8@xmd;vc=Q~u*p
zu{7l}so5~lRI`PVbVgh=Ma6ivV2Vdp(cTe(Ry>*6Jn8d<swbN$4X6+nRtz7T3TvQt
zOBJX0f?cpkP(`&-xp(805Y>MfsowQWmszs07E(21+V=5+Nb#jU8MCz=SGW3C9xvqA
zIT!4(Wo1O~nGh^KWQv!oB-%LX%lN6b2d^BKZ;scj45aaqtZdVk8O@Yt@fTCFVCJ@h
zNG=(<S;j{3%FSM9w%sZ&rCLyNC`;YGkkP|52q(kwRbW5lZ`dinIA`&GI&4Co3H(7g
z{5*CAUvTZQ$0dt2{z;V^4#Sb3x%DT3p}n<~b16N4aNWD>Vsb{{SuWL7>5!$m5KFS&
zToS1hMBW<sf=)Y~uA>c)n$7G+H=rr|7Rz?Ky;ZNdo)b#M))t9&zDT;i7D&iinSbXa
zqcKyV9LX6xorV+Nw~M_&g%*Oq!8nse5CaJQz(U6JV9vvsY=bP$Z-Wf3Ll>MtVBW0)
zbj$%5H$cW<P(ujpo?Y;Kew2ScKgu^ywf%qQP?7&|2u!{LK?Q(1My?qPvL0x=$a6e5
wOCb1#;Yr>aDCbH}(b#Z0*&KomP|c%S4i-VJ>j3P)?ZG90aKWrz1};E<0jxL=WdHyG
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-001.js
@@ -0,0 +1,44 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-001
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "dowhile-002";
+var VERSION = "ECMA_2";
+var TITLE = "do...while with a labeled continue statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+LabeledContinue( 0, 1 );
+LabeledContinue( 1, 1 );
+LabeledContinue( -1, 1 );
+LabeledContinue( 5, 5 );
+
+test();
+
+function LabeledContinue( limit, expect ) {
+ i = 0;
+woohoo:
+ do {
+ i++;
+ continue woohoo;
+ } while ( i < limit );
+
+ new TestCase(
+ SECTION,
+ "do while ( " + i +" < " + limit +" )",
+ expect,
+ i );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..b52648abb14a330b29a68b5040711819433f11c9
GIT binary patch
literal 1269
zc${rg0ZZFJ6uuotRze7+lp<2fO{8>IOIJjOlc}xMb<}P&aT~}cXLGH=Yc9K7t^Sbx
zj{P-%!d}ug(QOGN?|bjN?|ttj?cU&{gD%g8$LHtA!|%Sw1MTaFcfXCjS}y@(pR4YD
zsCX3lGN@*uqnYMYpfviv=86eND?gZIgyu3om`%CzM_HlVVM1h(w*7#qhb&=U4Q4{@
z9s`&JaR-;F3D=pQ4LIRJuPjr`$WL_ILXK{$UzqaQwcsawB$#3vDw}`jq*@>Fd3LmN
z@!ZmCmbR3Fvmh&M^w~8Rf_v#Y=tby3m{HbFXTd1$+Lqn}J&|8;e8E%tHaO=>bMG_w
zm~!aijAY0yXQcd4mwMxrS#B%NZc|uY$v&Bjo=P=kB9)5hN*xAHbT1uu*c+TV*{7}>
zN4C@LxV=vUT(2bKaIYhw7|b~Kb0Lc&Q}|O~8+S~ZZqMy^Eq)*Jk<Pn3(j69Y8%CW8
z{bu=YS#v3Gq_n?uhYsle7&Bk&Q+~(94BUG(N|(jPV3RT`7Jcb;JY!CSF5aPY1zZ2X
zna7nY`*MO02z^cJb^OZecFvElS|v};<8AIVn=OMLP{1@v&>B5Sq~I^1a;B*qLlaLn
z8jU4ENEwE)FYfJAXe)2|iWrx+={0~r>NL4B82?k>5~YRE+}Afx1{f_jm(7Uj@Lww{
z`V*nJZ2?Xx9k2D$9d^6fSNcV^b_pgq1KH~YBZSdUQYu*%UdtoWSOn{2dlA^=EzY6$
z7{PO+giW{+BKyb&Osd2{%WD}t9zM%I9zM%&kuv>%B|T9*N(0DOFlr)HGe|yeYvoDH
zgfO4CHZgjMZCtR8)B%7Z$-%Qka&)a|xujZoQMC36-as|m*e-9Gn_$x{S_RTrOW0*A
nq3_{!RA}W8GV$UjEo6`;GD#KXkr7u5P$j!0hl(jW095(|C}L@S
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-002.js
@@ -0,0 +1,71 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-002
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * Verify that code after a labeled break is not executed. Verify that
+ * a labeled break breaks you out of the whole labeled block, and not
+ * just the current iteration statement.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "dowhile-002";
+var VERSION = "ECMA_2";
+var TITLE = "do...while with a labeled continue statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+LabeledContinue( 0, 1 );
+LabeledContinue( 1, 1 );
+LabeledContinue( -1, 1 );
+LabeledContinue( 5, 5 );
+
+test();
+
+// The labeled statement contains statements after the labeled break.
+// Verify that the statements after the break are not executed.
+
+function LabeledContinue( limit, expect ) {
+ i = 0;
+ result1 = "pass";
+ result2 = "pass";
+
+woohoo: {
+ do {
+ i++;
+ if ( ! (i < limit) ) {
+ break woohoo;
+ result1 = "fail: evaluated statement after a labeled break";
+ }
+ } while ( true );
+
+ result2 = "failed: broke out of loop, but not out of labeled block";
+ }
+
+ new TestCase(
+ SECTION,
+ "do while ( " + i +" < " + limit +" )",
+ expect,
+ i );
+
+ new TestCase(
+ SECTION,
+ "breaking out of a do... while loop",
+ "pass",
+ result1 );
+
+
+ new TestCase(
+ SECTION,
+ "breaking out of a labeled do...while loop",
+ "pass",
+ result2 );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..b86d607b60b3031d7c0ede32ca45dd658db39e94
GIT binary patch
literal 1252
zc$|GwVQbnz7``3h2qA<ZA|fI|L`th7T`9s~ty<e!sx2n%24##hx!SBTCzn{)pRiB+
zU;7jLwD0`~+k0s>&W`0n?tP#4dER^Oz3cRcXEwSy8MOz4_UM!Eu`u@I$9F$TYpb6m
zw>}fSuQS1-$me16+>e={!Eioh!gtd`H4W{U#%v1Oa>oxnKb)kEid`B6DYGzSi!^Jz
z^tNLGq7-k*hQ2#s(=iimfF_~r?ocsdvG#d54}#h{WzEzz6+RsY?1;Gm6+q!(WfS9K
zD{Y!;i_V=NrKtsHq2e(GN>_j9)-e}T8eBrlDT8xF*44~|L98)g8zy4rfdkv+Ggeyy
zD^UVhkLRH)t**JwFR>2y9``nfur}b1VDx@<1G?=Be->Lu{KK6euoa%`->zb<6L9zb
z#&$;i;fb9-fnT_#^YItv#@Yi7=FE6$Qg~S}lA2-nx=#OMi2ZDGd(vZMvd~L3<bev!
z={x5=<GMGpC9jTmOov5rmqyH52oRkz>M`N)b3VcE)fj3@y`J;<Lhe#;Hs2~cJ9@7>
zXn)@Q=<!CQkrb?jAKzKj3h0;x%(Gk$w!=BIqUFI#0p~L-b(MjNh~?hcQhp;H-Y~qD
z{PP(biQgM%)a#`q_(qx)q9{ZqY9^~-6=CF(Le|uAj;MO&Imqf;&p}4tR#eo$2>!(!
zF6N7Qr0PwSfn4ce4UrbXDEXcaHUorSu@1i<ZUp~goi2-~|6^UgW<4E9)|q4-l2UHN
z5b%~5Xn|>Aw1rSrC5DaxHwm!}LNL*ZVQynoBTC*VV1(tOBV8^AGNeQS6rl>t1#1ux
z#R3_Uq91D3EWqTnmGRvSLU`XilieUHzbVT_DWhsl+bfokwwg#|*HkoA$f+>n8mM%n
R$-E--eaH<J?P*xH`vWIjNJ0Pr
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-003.js
@@ -0,0 +1,63 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-003
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * Test do while, when the while expression is a JavaScript Number object.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "dowhile-003";
+var VERSION = "ECMA_2";
+var TITLE = "do...while with a labeled continue statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( new DoWhileObject( 1, 1, 0 ));
+DoWhile( new DoWhileObject( 1000, 1000, 0 ));
+DoWhile( new DoWhileObject( 1001, 1001, 0 ));
+DoWhile( new DoWhileObject( 1002, 1001, 1 ));
+DoWhile( new DoWhileObject( -1, 1001, -1002 ));
+
+test();
+
+function DoWhileObject( value, iterations, endvalue ) {
+ this.value = value;
+ this.iterations = iterations;
+ this.endvalue = endvalue;
+}
+
+function DoWhile( object ) {
+ var i = 0;
+
+ do {
+ object.value = --object.value;
+ i++;
+ if ( i > 1000 )
+ break;
+ } while( object.value );
+
+ new TestCase(
+ SECTION,
+ "loop iterations",
+ object.iterations,
+ i
+ );
+
+ new TestCase(
+ SECTION,
+ "object.value",
+ object.endvalue,
+ Number( object.value )
+ );
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..359a35a30df81355e6a0686fc6a88a0cc815faac
GIT binary patch
literal 1256
zc${rg4Qtv!7``1x7D5P4M5IW$NfFl%aUx~7vR19_9IYEB-3DbVXL8!mGv_XsT7SrX
z$NpOX!FKT@vD*>|@B2Q_`@GM+mv*oJ!3NjogVyC`Yw*qYXdrz#fBQ>2tn?Pi$fu(F
zFcmZmeIAt4(3V8fiK0|5d`SgiwiJFaP6@SDy&p}e@ZA)^Z9gDlo)(H7!dRLbH~omQ
zl45yEFtyQWDR>;jGaVwvRHjfRg*J5BjJtQ`&qVlS$ml6`84*M(WUEhSDR1X*1{d2`
zPaWbjE+&M1Qs{)LQ-$TTC~#w`4b@^>P;!^-#k5`FPvyR{Munta(rmkYO4r+IbIvFU
zHb$NDFSkCUi4I;1D4UDc(ghh(#;BK23TroQ?#=VPQQCVo^;DRuU)#>0*FU$@tA3%i
zExX%sdLR36&sq(KzQO#7FZC%2!;C{i*&!jdlt{#6-Eex&MOV8gVpVx<(uXN^rS-Wx
zu$7R8k8s}Ocou8n3f4xP!<Tp_)S2H?;!)x73qIDR5=QtH+S^m?1^J*>YrrG3+qrDr
z)Zqd84F<z_tLjI<Jd&7?Fu^Q7KlQN3tJUgq2IG7R@n}R;;x+M5@H@J0SkuE~D^alY
zOFcHvs<M#r5x>XXO-%0zixhLSfsE8;ZA@NxI{nw#!Vyj_eciA)^X2V^gv-_bgNUY6
zuAM=*n_kRMw6l*O(lwANAP4{iKTtlOHQ|;8(C#uQpz1Qnpc80-CIsqR%0pef0H8yV
zQ8_9j4XmD3@Ob>B{&@VPzKe>r|0799?j#9ReFp*zKv_fic&urmZ39`ll{ae;Jcky{
zX0*hCN^;0hUkkmdZs$w~?N*-U%qD^jP|0ZZBG&hnO+9C3QK`OQADIif0Smya>j3C*
d`Jy7w&=$~98RUT$qgjQbcgO&_Bx|V5`U5ptWo!Td
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-004.js
@@ -0,0 +1,67 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-004
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * Test a labeled do...while. Break out of the loop with no label
+ * should break out of the loop, but not out of the label.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "dowhile-004";
+var VERSION = "ECMA_2";
+var TITLE = "do...while with a labeled continue statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( 0, 1 );
+DoWhile( 1, 1 );
+DoWhile( -1, 1 );
+DoWhile( 5, 5 );
+
+test();
+
+function DoWhile( limit, expect ) {
+ i = 0;
+ result1 = "pass";
+ result2 = "failed: broke out of labeled statement unexpectedly";
+
+foo: {
+ do {
+ i++;
+ if ( ! (i < limit) ) {
+ break;
+ result1 = "fail: evaluated statement after a labeled break";
+ }
+ } while ( true );
+
+ result2 = "pass";
+ }
+
+ new TestCase(
+ SECTION,
+ "do while ( " + i +" < " + limit +" )",
+ expect,
+ i );
+
+ new TestCase(
+ SECTION,
+ "breaking out of a do... while loop",
+ "pass",
+ result1 );
+
+
+ new TestCase(
+ SECTION,
+ "breaking out of a labeled do...while loop",
+ "pass",
+ result2 );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..3ef54c60091fc8e2bf8222e25fcd53e4ad7b217c
GIT binary patch
literal 1115
zc${rg@oU;Z6h4k1A&5vQnTV8|lp<}HS=*JZE2V1F&Y{^bX}3{EInAj@V@@vTT>r}b
zHT!)p(Hc9NACC9Fci;EE_b#oD``JTx*ZpR%*X;k~0gDt@j~`#<>{=&HMx06K_e`=l
z<|4AYTro*QPe~q)GkiA-Jw+9p0`<5F`8Y~KpUN>)nP4p|WkloNorhty#iIbUv&)q>
z4a1FAw^VXE2-zhYhE!4o*v|i$kY$%GHndxz7(Nitrt&d^>#K3x`IJdM%nFs3Wb|P@
zO0`P|EDTw&M##-9fN;as)jS#|UN&syy`khYMPOPc6$`+nHxx5QF2%PA57}C+^h9on
z;E`MjIi=xO5ScQt7vFh)zvEte+4H>3T@*a0?RUPo`i#bL?iZDq7r@FqRELJ&@w-mZ
zXR&J2n62Q3<pRKhbd(i#RJe8e9;o1bvvqUr-t<~d-w<=?YVasxk}M=_=o6y>lfLMR
zu^B5WRU(bgE=QDyrzGG386@i>KqO*Bmdr5eW6a<`QJ8!Wgl*f4WN5PBYC`C;&H^$N
zFjF*VB!1dP-f8!m_YG}-KYw(1()e)Hi00D)NP>1K#EhhmmaHr8W)>o$p4&*rShlfW
z@&`(~f<f$;SWtAIYfrcWuK^=;l-$TftU#oLy{XsV-T8gT$=>NN-r3b~(a=lC*wQdU
z82!O!QOjd9kMQ|2*un?Pz`%RUpoHsM0TGPg+_rGZDp^3SAp`PaioVCFijZOCiw77P
zdl<dOrl#j|WwiPr(J_XzfY0DGG2Sj)#st?&Rf6pG#UB@zajtJyEW^|)m6WuTl5nLA
jZFX}Q<x={wwuSOU2OEub4=4d>Cg2IiNMC2CkQM#`piV~O
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-005.js
@@ -0,0 +1,73 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-005
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * Test a labeled do...while. Break out of the loop with no label
+ * should break out of the loop, but not out of the label.
+ *
+ * Currently causes an infinite loop in the monkey. Uncomment the
+ * print statement below and it works OK.
+ *
+ * Author: christine@netscape.com
+ * Date: 26 August 1998
+ */
+var SECTION = "dowhile-005";
+var VERSION = "ECMA_2";
+var TITLE = "do...while with a labeled continue statement";
+var BUGNUMBER = "316293";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+NestedLabel();
+
+
+test();
+
+function NestedLabel() {
+ i = 0;
+ result1 = "pass";
+ result2 = "fail: did not hit code after inner loop";
+ result3 = "pass";
+
+outer: {
+ do {
+ inner: {
+// print( i );
+ break inner;
+ result1 = "fail: did break out of inner label";
+ }
+ result2 = "pass";
+ break outer;
+ print(i);
+ } while ( i++ < 100 );
+
+ }
+
+ result3 = "fail: did not break out of outer label";
+
+ new TestCase(
+ SECTION,
+ "number of loop iterations",
+ 0,
+ i );
+
+ new TestCase(
+ SECTION,
+ "break out of inner loop",
+ "pass",
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "break out of outer loop",
+ "pass",
+ result2 );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..19f75d2f9718df7e01d95f43e351fa0218c5ff60
GIT binary patch
literal 1355
zc${@o|4Z9I6hFgp93g}fN-3pCC{l{6r7I%h+|bsl9a=||Z9m8+*W}cjX|7zZbAtcE
z{?+{rdso}06P6$DegC}AdoSI=@MD0k&ql|Wm&c=TBIc<U`sp2`9~y(XaVxm$|C%bE
zWkROy3!%AUNmt5*vosIXb2ZRR^9j_}x+0B5dY1#)H^W(yRC_E*^8Cgzh`ZEO<j$r+
z5z!@|jMw{DhWs(NS_?LTR?sH*@2?l<=pj>gT-U!aCD=IOCp=1+f<&3x-9$zY)$m?q
zIm*`SM5&hJ4`&muM3m?HFe+0|Yx_8zrICSN>(T@&TxlME0>^{{QV_{0FE3NOGJf(;
zrJAs0m64SOx2uKvO8{UtFWr4TT)ygRS8?``-{OLed6MvW<=O5@xQ^+|){e0`;(Dg?
z8~UH8F{o>kp2)BFBH^nHCy11o>gymJ4Tfhy{txZoLr0E(@JJWNhRfAV7w79UJu^3v
zatc>-=dnTRE^ytT-wOv<!^*<Gnj?^(Ou4{dmgtUcDzk<4)(!{ZMc)=_DtIB}neMTS
zyI=aF06?raww!6fsfGYPd~f-sSUwuqopyWA%QREk)Hwa#<?&6YdoQ#f$(Z}>7Kr+$
zkuOpoFqYP%f)UO+i@6Hrg}lQ%JH=SGTCF+i{{Vp9!ottb*Wsw&&)4*u95yMjT|$Xd
z-Xz!|$U+gRlnRbjC62fKqHKDt7p3g&VH-6q1aGHg`S2mfYoIdNcHJr<w@NI4*hKSh
z>uBA-vGSv%fAcpMe)=kZ=`R@nmW65ni48uYgfxgn5UpEii19w!Eh2=s{kjWc*#(s;
zwf3xq*f7;LsJJ)>a2p;42ud(18kln%JH-k{*oY!38UekGpokhl5Xl+95(qANpb>jT
z<&XWcr;>$U6o_|fW%?a=DrI_#4{StWU|>|k+d$Q7*Qk-SU4ag*lC=S^2X6sYn-o^N
Xzv~~ExXCq(LM0ROO{l%Qa(aIOUf5>V
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-006.js
@@ -0,0 +1,89 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-006
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * A general do...while test.
+ *
+ * Author: christine@netscape.com
+ * Date: 26 August 1998
+ */
+var SECTION = "dowhile-006";
+var VERSION = "ECMA_2";
+var TITLE = "do...while";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( new DoWhileObject( false, false, 10 ) );
+DoWhile( new DoWhileObject( true, false, 2 ) );
+DoWhile( new DoWhileObject( false, true, 3 ) );
+DoWhile( new DoWhileObject( true, true, 4 ) );
+
+test();
+
+function looping( object ) {
+ object.iterations--;
+
+ if ( object.iterations <= 0 ) {
+ return false;
+ } else {
+ return true;
+ }
+}
+function DoWhileObject( breakOut, breakIn, iterations, loops ) {
+ this.iterations = iterations;
+ this.loops = loops;
+ this.breakOut = breakOut;
+ this.breakIn = breakIn;
+ this.looping = looping;
+}
+function DoWhile( object ) {
+ var result1 = false;
+ var result2 = false;
+
+outie: {
+ innie: {
+ do {
+ if ( object.breakOut )
+ break outie;
+
+ if ( object.breakIn )
+ break innie;
+
+ } while ( looping(object) );
+
+ // statements should be executed if:
+ // do...while exits normally
+ // do...while exits abruptly with no label
+
+ result1 = true;
+
+ }
+
+// statements should be executed if:
+// do...while breaks out with label "innie"
+// do...while exits normally
+// do...while does not break out with "outie"
+
+ result2 = true;
+ }
+
+ new TestCase(
+ SECTION,
+ "hit code after loop in inner loop",
+ ( object.breakIn || object.breakOut ) ? false : true ,
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "hit code after loop in outer loop",
+ ( object.breakOut ) ? false : true,
+ result2 );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..f70c2b6289a67f5781d339881a831515dde3887e
GIT binary patch
literal 1419
zc${rgeQO#q7?0ry$02eYa)=yqh=@2R&PpeCjH$JqMeXp8?vFA`)YRU3UP_E}g?^lU
zn|+pjhb8glr1kzt^8DWNJmEV1(Uk{oFURfSus!|}%t*uo{(SZiHEV-_6NbYMr6Ivl
z@AnfU%Vj{LQeUa=1Hxjk7#}^3IavsaaW`6pVMW%#bVwGHLqm2%)(4qwvCSjtib1D~
z!!R!MogkV8(LBDsx^2<pOyIGy5vTc>%?Xb!t_Z>GIo2ATkWL@VT`ID<sPVy#&BNAT
zXF455@Z)}1yMMnwJN`qkjAIHnm<4zel5;W*F~gj);%i9A+;jT<AqdGnCO^Ov5{6{9
zN8Ag_7C8JS919{wUluP`(Nvlbaw?)z!Z?}jW!{uNk<3oop|fXqrxAT9Ht9`S@WgLD
zf7~Bkdhwqy)Gm^A@{>$?cH7^zs#4o3<@LIL|9WIk<a1oF_;p0ImzRC%uc_&iCGX-T
zG3bg1B&Dc+loHRg3VFlu`~IMZeqn}!=))GR>q5ILcKeA0>)Czu10zI2C#jp>*b_|{
zK@<f9zDv(&wOU=v{xVAK-qRIpxf`p?rLpC@YbO4muLREs^XY)jttH2d%WgOAyEGCq
z=-M-?vfkHfA9Wtnd`(+!vezB9@9MYyxYvuH4eO^3q-jt`$S!LT0SM0Yd@+-R1ru4H
zH;1xyzB$-dO-sQh1Y$k4p<T7B5Lus~Eo#ky285Olw%;L?I0hw-L5X8f;%)pJ=#A>A
zaTEUqf+_$tL(k?4B?tgAVa3wToLMkSW){^UXz5zg$?GsDH!-=~im)U%3udKRgFrd8
z3W6q(p1;u2l4)1mkW4#j&8syHK-nw-kU@V8SBF5)AOv$JQsP9pqNpofQpuQdKtdvx
zLMlk5DWn){(qcdZrUZ(tR#ryK5uq!=iUd1Z+mNt~R+J;DrlcBzib;8s66E)S`fEW^
H3DW-oH;z|8
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/dowhile-007.js
@@ -0,0 +1,97 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: dowhile-007
+ * ECMA Section:
+ * Description: do...while statements
+ *
+ * A general do...while test.
+ *
+ * Author: christine@netscape.com
+ * Date: 26 August 1998
+ */
+var SECTION = "dowhile-007";
+var VERSION = "ECMA_2";
+var TITLE = "do...while";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( new DoWhileObject( false, false, false, false ));
+DoWhile( new DoWhileObject( true, false, false, false ));
+DoWhile( new DoWhileObject( true, true, false, false ));
+DoWhile( new DoWhileObject( true, true, true, false ));
+DoWhile( new DoWhileObject( true, true, true, true ));
+DoWhile( new DoWhileObject( false, false, false, true ));
+DoWhile( new DoWhileObject( false, false, true, true ));
+DoWhile( new DoWhileObject( false, true, true, true ));
+DoWhile( new DoWhileObject( false, false, true, false ));
+
+test();
+
+function DoWhileObject( out1, out2, out3, in1 ) {
+ this.breakOutOne = out1;
+ this.breakOutTwo = out2;
+ this.breakOutThree = out3;
+ this.breakIn = in1;
+}
+function DoWhile( object ) {
+ result1 = false;
+ result2 = false;
+ result3 = false;
+ result4 = false;
+
+outie:
+ do {
+ if ( object.breakOutOne ) {
+ break outie;
+ }
+ result1 = true;
+
+ innie:
+ do {
+ if ( object.breakOutTwo ) {
+ break outie;
+ }
+ result2 = true;
+
+ if ( object.breakIn ) {
+ break innie;
+ }
+ result3 = true;
+
+ } while ( false );
+ if ( object.breakOutThree ) {
+ break outie;
+ }
+ result4 = true;
+ } while ( false );
+
+ new TestCase(
+ SECTION,
+ "break one: ",
+ (object.breakOutOne) ? false : true,
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "break two: ",
+ (object.breakOutOne||object.breakOutTwo) ? false : true,
+ result2 );
+
+ new TestCase(
+ SECTION,
+ "break three: ",
+ (object.breakOutOne||object.breakOutTwo||object.breakIn) ? false : true,
+ result3 );
+
+ new TestCase(
+ SECTION,
+ "break four: ",
+ (object.breakOutOne||object.breakOutTwo||object.breakOutThree) ? false: true,
+ result4 );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..11087e1cabc6f836431edf8e6ec4987ce5b92441
GIT binary patch
literal 3172
zc%0Q!>uTdh7@ZD62qT0s!Wd(WFvf&j9B<;JX*O3Uc9JFW2HOeCW_Pn=Y2s)jOJ*b|
zasTy6`Vf7TzR12o`;D%S8@hqAEj3s(-*wJ8-%R7A{ichqjyn5iXZxLxra^7b^d_%=
zlNxg;zHwtx)_fc>>bj<5SCVblBOV<>O6}D2C?i&TJfzIjlZ<K@=z7ew2Z_JbFl_@o
z$pQH`eV97rk}#9>EqX|Gi!kDWuRQB>m<DYKn<RC$17|oId(=3i!~Qht`aUcJn}h8U
zHlSW|@*<~U>a!K8>-N~Pa)-nt=gb*V=1sJVkpYaSV21Rfgf<z{NQ;K!Sd`dF^43#q
zvw%_!%hB)V5_eLmffL$O0~F}$a8#u=wso$_lstt4Vp&N|E=p-Q#-z}4*hw<3#i-vo
z)D9`Y^}A}2H3Tw|)79SgzfgS&NTI<fxr_UhPD!6y7Byl|4q7DP0|z9w$29iHU7eXD
z@2cDDoV1U+$z^+;dXydiF!7!+Y%1O6LGR>kTehe@@NUyR>UsynrRpe9+N5qi5`CXB
zG7%OQ6aYE4yn48<r2If=tqR-Q@;$M})WuQet900HqF(ZdpRek-RKN3iDgmM^X+&IC
z`k69E(P4zdp5P_5Zw?qW`X)2dHuYScj3}<*kJ5w^mT6oZwJ**Z&5q&=f4vf}8;yH-
zA2$=N&--i6*wdUF&EhIjL+kSkApC*C<kfI}br}}9k&Lcp+S(0Vf6H-38evqUoEk)p
z&fgsXCDm#bYI$9%chWm;<^zt^K<9Oz{L|v7NV#lwx-b&F72^6aT<fJ|C}E#4vi2cF
z69I@BXr`+<wl&e{Bh~qv086LR4KXe2*7HW2%gZiY$+24<g5*{BFZag-cVrQ7*}Zih
zuEDD619R6jwpZ)*jkUE5;56-}TJ06qv<C)n@R$;VvYvD54CLm)+5YuPwRcMs5fU_#
z2iGeDCiD13Q~P5Nu74k1ue`ci+xV$=)$25y$!)zZ?9HW><DJ&~Pw)0p(w5ln30OoJ
zEfp#<ma!s<;!UvWiB_;_i*~Tt67Qppffo_O2)<vkI9*H^ktp7xHrU6fc)ca%i;{r+
zUwSWJtcvw~aWio2{R)nCaS>8?UY^=|dFtNFQ%4xhBeWs_5rpP25-@C$bX*s)gmP7k
z7H|qzR3(M7kWx|0{-#z!N){;+Lgm~J#+4E(XHi+oAe2E$y2eA{(O-ABWSj@VgwO$K
zE|I`93Mj1#<y;Hn6iRJMNaP}lbI<_^;zrO52^mxdP>_*_4Dp;7W&z-Hpm$=>O_<SN
zK+odfBzz1nVo_1QCj&{W$OX=!6?33i39ed2oR@J1HgZUV?+ei!<Sdf?IkZL2ppZp{
zfPu^z$O(guLr|h3_BoOaN751JQH5J&ZheRoc@=jXQ-tK0JLgr1t>C2Ce8NeQg_5S`
zGMv`?nAYz&8w^5=s{&h{v2!zaX2uq#Y_3SjS7g&G=XxUMlhHt(Qas>d;8Z~dzGnPy
zj`N)3^gnAqr1MCNMTqD1#t*2$1pU-g-;=<J0}Vfr`?eaN{xvmLzNN;>f3L>7SdCw>
a`hC@SR)d{LgMUo&>+bW9dhdVzsQ(0ENM4r!
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/forin-001.js
@@ -0,0 +1,297 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: forin-001.js
+ * ECMA Section:
+ * Description: The forin-001 statement
+ *
+ * Verify that the property name is assigned to the property on the left
+ * hand side of the for...in expression.
+ *
+ * Author: christine@netscape.com
+ * Date: 28 August 1998
+ */
+var SECTION = "forin-001";
+var VERSION = "ECMA_2";
+var TITLE = "The for...in statement";
+var BUGNUMBER="330890";
+var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=344855";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+ForIn_1( { length:4, company:"netscape", year:2000, 0:"zero" } );
+ForIn_2( { length:4, company:"netscape", year:2000, 0:"zero" } );
+ForIn_3( { length:4, company:"netscape", year:2000, 0:"zero" } );
+
+// ForIn_6({ length:4, company:"netscape", year:2000, 0:"zero" });
+// ForIn_7({ length:4, company:"netscape", year:2000, 0:"zero" });
+ForIn_8({ length:4, company:"netscape", year:2000, 0:"zero" });
+
+test();
+
+/**
+ * Verify that the left side argument is evaluated with every iteration.
+ * Verify that the name of each property of the object is assigned to a
+ * a property.
+ *
+ */
+function ForIn_1( object ) {
+ PropertyArray = new Array();
+ ValueArray = new Array();
+
+ for ( PropertyArray[PropertyArray.length] in object ) {
+ ValueArray[ValueArray.length] =
+ object[PropertyArray[PropertyArray.length-1]];
+ }
+
+ for ( var i = 0; i < PropertyArray.length; i++ ) {
+ new TestCase(
+ SECTION,
+ "object[" + PropertyArray[i] +"]",
+ object[PropertyArray[i]],
+ ValueArray[i]
+ );
+ }
+
+ new TestCase(
+ SECTION,
+ "object.length",
+ PropertyArray.length,
+ object.length );
+}
+
+/**
+ * Similar to ForIn_1, except it should increment the counter variable
+ * every time the left hand expression is evaluated.
+ */
+function ForIn_2( object ) {
+ PropertyArray = new Array();
+ ValueArray = new Array();
+ var i = 0;
+
+ for ( PropertyArray[i++] in object ) {
+ ValueArray[ValueArray.length] =
+ object[PropertyArray[PropertyArray.length-1]];
+ }
+
+ for ( i = 0; i < PropertyArray.length; i++ ) {
+ new TestCase(
+ SECTION,
+ "object[" + PropertyArray[i] +"]",
+ object[PropertyArray[i]],
+ ValueArray[i]
+ );
+ }
+
+ new TestCase(
+ SECTION,
+ "object.length",
+ PropertyArray.length,
+ object.length );
+}
+
+/**
+ * Break out of a for...in loop
+ *
+ *
+ */
+function ForIn_3( object ) {
+ var checkBreak = "pass";
+ var properties = new Array();
+ var values = new Array();
+
+ for ( properties[properties.length] in object ) {
+ values[values.length] = object[properties[properties.length-1]];
+ break;
+ checkBreak = "fail";
+ }
+
+ new TestCase(
+ SECTION,
+ "check break out of for...in",
+ "pass",
+ checkBreak );
+
+ new TestCase(
+ SECTION,
+ "properties.length",
+ 1,
+ properties.length );
+
+ new TestCase(
+ SECTION,
+ "object["+properties[0]+"]",
+ values[0],
+ object[properties[0]] );
+}
+
+/**
+ * Break out of a labeled for...in loop.
+ */
+function ForIn_4( object ) {
+ var result1 = 0;
+ var result2 = 0;
+ var result3 = 0;
+ var result4 = 0;
+ var i = 0;
+ var property = new Array();
+
+butterbean: {
+ result1++;
+
+ for ( property[i++] in object ) {
+ result2++;
+ break;
+ result4++;
+ }
+ result3++;
+ }
+
+ new TestCase(
+ SECTION,
+ "verify labeled statement is only executed once",
+ true,
+ result1 == 1 );
+
+ new TestCase(
+ SECTION,
+ "verify statements in for loop are evaluated",
+ true,
+ result2 == i );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled for...in loop",
+ true,
+ result4 == 0 );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled block",
+ true,
+ result3 == 0 );
+}
+
+/**
+ * Labeled break out of a labeled for...in loop.
+ */
+function ForIn_5 (object) {
+ var result1 = 0;
+ var result2 = 0;
+ var result3 = 0;
+ var result4 = 0;
+ var i = 0;
+ var property = new Array();
+
+bigredbird: {
+ result1++;
+ for ( property[i++] in object ) {
+ result2++;
+ break bigredbird;
+ result4++;
+ }
+ result3++;
+ }
+
+ new TestCase(
+ SECTION,
+ "verify labeled statement is only executed once",
+ true,
+ result1 == 1 );
+
+ new TestCase(
+ SECTION,
+ "verify statements in for loop are evaluated",
+ true,
+ result2 == i );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled for...in loop",
+ true,
+ result4 == 0 );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled block",
+ true,
+ result3 == 0 );
+}
+
+/**
+ * Labeled continue from a labeled for...in loop
+ */
+function ForIn_7( object ) {
+ var result1 = 0;
+ var result2 = 0;
+ var result3 = 0;
+ var result4 = 0;
+ var i = 0;
+ var property = new Array();
+
+bigredbird:
+ for ( property[i++] in object ) {
+ result2++;
+ continue bigredbird;
+ result4++;
+ }
+
+ new TestCase(
+ SECTION,
+ "verify statements in for loop are evaluated",
+ true,
+ result2 == i );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled for...in loop",
+ true,
+ result4 == 0 );
+
+ new TestCase(
+ SECTION,
+ "verify break out of labeled block",
+ true,
+ result3 == 1 );
+}
+
+
+/**
+ * continue in a for...in loop
+ *
+ */
+function ForIn_8( object ) {
+ var checkBreak = "pass";
+ var properties = new Array();
+ var values = new Array();
+
+ for ( properties[properties.length] in object ) {
+ values[values.length] = object[properties[properties.length-1]];
+ break;
+ checkBreak = "fail";
+ }
+
+ new TestCase(
+ SECTION,
+ "check break out of for...in",
+ "pass",
+ checkBreak );
+
+ new TestCase(
+ SECTION,
+ "properties.length",
+ 1,
+ properties.length );
+
+ new TestCase(
+ SECTION,
+ "object["+properties[0]+"]",
+ values[0],
+ object[properties[0]] );
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..7ee7b9abca614cec87b8b8a05862b1392dcdfc4d
GIT binary patch
literal 1359
zc$}S5(P|n&6df<iuq?|W5<(COgNT^KE>=PaZ7oq_5=%72UDAh8!m1Oq&AKDwnA9KW
zLqDUxRr)WT+0~4sd8!LD=bo8+&b`-Zb^D(@baOsv_Il01*KkZ@5sKye-}tD~O@h0S
z^3L}er}KHpV)rr>ln0R~co<JKPg-Fd@TDfo8hRoSbSkw9?I4OYpYPKr9Tla*SZZq5
zf`1>*^@U@l6OMXxI;6ZQsY$Fv{eVxXsAxiGlq5;HpyO7=Mi1VI&1h{^e~Yn*2C=?t
zC3mdb{vwLX*8vZMVMI^qC<?fAl?|RTJ`JMJGMrK=F)yDj;*mPpxU{q8T5P<muHBz=
zk_yP0mL>^Ndg;b^{!1wCpT|~fv*~OhGt$;|%>`LgSC9Ab<xun}*KPL~Q_91Umax4M
z4`<@W^9SAjxu+k%AL9ZJY&QHxM<P4pvQ93Rj@N1X-K)Nn7~j^jz2#MM!+H#&1zpi^
zv+FTfe%HV3;KzU)dp9RfvMCZVHX~t70&>T=>$(yu$|a;?G#Xi-&P6+zQ|l{fG>A#1
zuA>%GA<lJY;7N0X?B!%`7{962>ZXthS;1suax@a84>LCx0T)V)JaO6j1r5fO`|OfU
zikylCkBN|v%T3Ep)~mbye@@5&sX42sk`ru&>`uGaysZOq{d=n0AoKMfQGHFQSUg_Q
zE1AmX`QD8`=yde>AMjz>#Exm180Sg`;0&NPE)=$GsMr`PDJa3m6y%_VO;iIU*ZMXX
z$Uq3g3Ca<KWVQ_m<!x&hgKg)FfMyoXWgQ#YYCEz}76TkA?56ls;cAMH75<RoGb!&F
z;K<EPHzx}gvM_9C6qi?lV&1KpEvTd9XP(G#A5dBl0LqjBsV`$YsxDA<{epc2J6j3;
z6Wp5d9L0bwR2Z5FtKRenI|yJK8L$gQxt6yxM!qT&3=<J7w^!`U4ZBT?9~<WXYxftX
C5@sa;
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/forin-002.js
@@ -0,0 +1,77 @@
+// |reftest| skip-if(Android) -- bug - nsIDOMWindow.crypto throws NS_ERROR_NOT_IMPLEMENTED on Android
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: forin-002.js
+ * ECMA Section:
+ * Description: The forin-001 statement
+ *
+ * Verify that the property name is assigned to the property on the left
+ * hand side of the for...in expression.
+ *
+ * Author: christine@netscape.com
+ * Date: 28 August 1998
+ */
+var SECTION = "forin-002";
+var VERSION = "ECMA_2";
+var TITLE = "The for...in statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function MyObject( value ) {
+ this.value = value;
+ this.valueOf = new Function ( "return this.value" );
+ this.toString = new Function ( "return this.value + \"\"" );
+ this.toNumber = new Function ( "return this.value + 0" );
+ this.toBoolean = new Function ( "return Boolean( this.value )" );
+}
+
+ForIn_1(this);
+ForIn_2(this);
+
+ForIn_1(new MyObject(true));
+ForIn_2(new MyObject(new Boolean(true)));
+
+ForIn_2(3);
+
+test();
+
+/**
+ * For ... In in a With Block
+ *
+ */
+function ForIn_1( object) {
+ with ( object ) {
+ for ( property in object ) {
+ new TestCase(
+ SECTION,
+ "with loop in a for...in loop. ("+object+")["+property +"] == "+
+ "eval ( " + property +" )",
+ true,
+ object[property] == eval(property) );
+ }
+ }
+}
+
+/**
+ * With block in a For...In loop
+ *
+ */
+function ForIn_2(object) {
+ for ( property in object ) {
+ with ( object ) {
+ new TestCase(
+ SECTION,
+ "with loop in a for...in loop. ("+object+")["+property +"] == "+
+ "eval ( " + property +" )",
+ true,
+ object[property] == eval(property) );
+ }
+ }
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..7ab4e2653c7529b7add4c553d8cb6b5fd1a6fb7e
GIT binary patch
literal 729
zc${5O?~B?%5M2h55JCv)AtG`ta)|wjC->p#wI7TPHbqlNa`#2rV>P2L-An9dQ+t0|
z|Glo&c8~6d*_k)*y`9-0ia(`fF-^wv`8fH)b1W2Bk2hhX_h!ZwN+wbzd9ew9?j%+f
zFN;C+hqUG>4cH5Kk!zaiUEDFr*;3#KTnQ$bDrNtFNDKSMBUMb{gVuK^ObCNh?ak!l
zlL^N9+7t(>0j~_0F}XoyMj4(qiR%ZHd}TEDeOwFCiq`+0cG8vPJ7ou=Tz#Y35~adi
z&z-Ky9d=^e8}%a1k|>_0=GT6~i{=j|-87tJ(dXFF#9Am=0<*Iyn}yDfX~*2X3zJm$
z;iVtkPUG8o5GKy$)%Epg<gQEkdN{oFE5)SBuu_)N;oX{Xf%#iX8GTQewAz-n$f-nC
z%YqKQ198GCq<g7X{fI0_nU%A0)62F<`I^$|?}k8~a55j?kG^VnaPoWpite{4QJ1X9
zHNbSfEY+6c_nHZ+N;+I*Nf?@4Z=iDy#B+VHU8~suLV!GjwnZE`RIOv;lKwHVN$;5W
z<ji)U4Ma!U0@rgr0CEAgMLN1|osrWy*3BpNLEa!v+w(1Gc3Upkp5GwdmQCSYLqG<a
K($KygAin|A#m>V3
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/if-001.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: if-001.js
+ * ECMA Section:
+ * Description: The if statement
+ *
+ * Verify that assignment in the if expression is evaluated correctly.
+ * Verifies the fix for bug http://scopus/bugsplat/show_bug.cgi?id=148822.
+ *
+ * Author: christine@netscape.com
+ * Date: 28 August 1998
+ */
+var SECTION = "for-001";
+var VERSION = "ECMA_2";
+var TITLE = "The if statement";
+var BUGNUMBER="148822";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var a = 0;
+var b = 0;
+var result = "passed";
+
+if ( a = b ) {
+ result = "failed: a = b should return 0";
+}
+
+new TestCase(
+ SECTION,
+ "if ( a = b ), where a and b are both equal to 0",
+ "passed",
+ result );
+
+
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..bfe79975e5410bfce140ca49fd2448018334f7fa
GIT binary patch
literal 1024
zc${5P?P}XF6xD<<#+YDC2_}RhLI|N>gszmat*mk8b{T25#cuzUQB+$Arix``d2OCz
zudp}SEA0^`r;XLtKg7M~oO|w(?2o5kLvVdQ8(v%tXFt<~W-^tl4}Xn!{qee)r&I(F
zxu8Xn@@z0kB^88C%Ow?Qtcjj3LrElEs@e94FsAX2pJqv#EwnFI2oWnSIe4-UrBFhR
zcdv*@$t|OwY0QWqk_+o*S~AvqO(?PDGalb<lKPx8N;2(*hebh!q=_00W1iC^1*D6t
zN*ocfpi&3izI>UlGvbQLN~-S|EOWW4+t!rcYkAujl-$*%cUER`mC)zOs<&yLCAY&^
zq`B-&$Sq}zCiUdrCi8ctTvBzhb@JwTUQ6&97fZrwLE$MtvzK|IN*(PwjArBMd8mJR
z2@l-$;)oW~R<e@GMi`8u@wchP(q$@*UqrxND;h_Wz@`s5jiqtVdE+XWg-QhX@x4%w
z{)Li+iil760%E6f8<B$A!RTUmbLihzPl9<VF`r|CS+$WSc+Lf8oagT`IyrII=>A~v
zwmW&^i_J|6Qz}RJ(N&0$l{?zqy^dx<ps(@+?RW?R(?GV1AOaBVBhNK$*f5dZc`RJJ
z{aDy`7a3p&0(CZ<&{7{jwg+t0gPyW^`s(5Z{_j&=RQL{RZ@pqpf1g&2hng=f6!7Nx
zY!8Ay00#zY7z*}O9tc%of<p_LhS_kG;E%EA9Jyvo#fG(+)d#R%bqw}eaLeh#frZsR
bW6LpM*Qw5J2cr&XwM>94%iabCXaM*hfh`=a
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/label-001.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: label-001.js
+ * ECMA Section:
+ * Description: Labeled statements
+ *
+ * Labeled break and continue within a for loop.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "label-003";
+var VERSION = "ECMA_2";
+var TITLE = "Labeled statements";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+LabelTest(0, 0);
+LabelTest(1, 1)
+ LabelTest(-1, 1000);
+LabelTest(false, 0);
+LabelTest(true, 1);
+
+test();
+
+function LabelTest( limit, expect) {
+woo: for ( var result = 0; result < 1000; result++ ) { if (result == limit) { break woo; } else { continue woo; } };
+
+ new TestCase(
+ SECTION,
+ "break out of a labeled for loop: "+ limit,
+ expect,
+ result );
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..2e0e212d8bcfb2cc477c28f1513d0791b6911368
GIT binary patch
literal 1347
zc$}qDVQbnz7``1x2q6n1A|g@_5pk^(E2Wfnj;T#si`rpAzepLUx!SBT7cS>oxAtf3
z``F*upW8*Fv1Q-(A$RvaywCGK@B60R9b8&qbUtkL`>o-P>rh{~VsY|TJ+5?@!L3WV
z`515-hA#7KJy%dpJWFubpC))Yd0K)9I+N65+w~opmFQrJ5Wd)=#d4oH3n&+h0hv+l
z%V6$#xl<y@8ZLB*=OwIzmb|8ZRKq5GO2t-%tMOMl5lL>roCRXB@uamqHn}fd6Yi3+
zM^EX*Bb*4v%deq`+vb$qZ@A^Nxj%{UtrUF5_)Pkj;f%^w!eWn%spnB=Lp$oQS-|GL
zlekXoRV64pq|Qdcn#i8>1Nx98RsO}SN3wIt?9<tJdqo9lshez}9*?-qm`919<mJ}w
zw3)NOYaen9O9#3&;cg&CmObna&aLFn=qLkSD$G5hv*oM}%k0?QtARlu0~t2rdp{M#
z+tU|}-7%J4PR6F8$ZTE>)NCquZdLh4xWas@*<HJ5s^2MR2KE`}Zit?q&|VYn!8!^W
zDA-R$ybcMeacvGQSr_huU#kko_?B^8!Rx}<_3_FheusbHm214$jKR@5@8$%LqfO(L
z41Rw8{ojJmuOw9=ZR=*I-}=%pqW)yJ5U0Ip67TEvMrk<{>fms_xDY>Zxw;EV9LjCh
zW7AAL5;?Gp{NgAr8C*nDF{EZBJ+g<UnQZJ2IyzL4kx~_uuOWy41V2%(kkw&cLGaV+
zQG>^;M;^9O3S2@U&(kbaOKJ%q_z~n~Y?PEt78%+u%oth)?!XIpwgs1A!O-e32S31`
zgj27xGjL}M-eebGPQphJU;rwrqACyqpeshvP!uRbML&SxNk!E(fQ^!#(`!mStpS+R
zvk;YwX;70LY1th;i*`YESCw`T8*fysrU3xz@>E_*r(Q~HiF6gl(s`6fOXWoR;I;H$
DhX917
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/label-002.js
@@ -0,0 +1,56 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: label-002.js
+ * ECMA Section:
+ * Description: Labeled statements
+ *
+ * Labeled break and continue within a for-in loop.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "label-002";
+var VERSION = "ECMA_2";
+var TITLE = "Labeled statements";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+LabelTest( { p1:"hi,", p2:" norris" }, "hi, norris", " norrishi," );
+LabelTest( { 0:"zero", 1:"one" }, "zeroone", "onezero" );
+
+LabelTest2( { p1:"hi,", p2:" norris" }, "hi,", " norris" );
+LabelTest2( { 0:"zero", 1:"one" }, "zero", "one" );
+
+test();
+
+function LabelTest( object, expect1, expect2 ) {
+ result = "";
+
+yoohoo: { for ( property in object ) { result += object[property]; }; break yoohoo };
+
+ new TestCase(
+ SECTION,
+ "yoohoo: for ( property in object ) { result += object[property]; } break yoohoo }",
+ true,
+ result == expect1 || result == expect2 );
+}
+
+function LabelTest2( object, expect1, expect2 ) {
+ result = "";
+
+yoohoo: { for ( property in object ) { result += object[property]; break yoohoo } }; ;
+
+ new TestCase(
+ SECTION,
+ "yoohoo: for ( property in object ) { result += object[property]; break yoohoo }}",
+ true,
+ result == expect1 || result == expect2 );
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..28b7d1266f7fe7435a35dad44159e6f518598e58
GIT binary patch
literal 479
zc${5OUrWO<5Dy`gQHl%^8Dq#8GKLSL;FCV+I?JeReQ1g=MI>v_5tcRemdX51ehxp6
zAHi&lMLZ6YyWgMOC5)3NPV#X&oKA=7i!7ls(tO@sv+mVI8bG0v^%77P(WXXNt)#B{
z?#hiYu(X;%yi>kOK!@H8?J=*mcqVWT#*qdNa{SInDCJ83HCZdw3uRTxYVNdtsC2RD
zS_eP_<+DIu=o&g9f><0T>f62)GX;-OD1pLQ$AA|oYje5Zj2pDZ?!oi_5{<oyn1NDI
z9(;42rExOm?yr)7ZhW=nwGnEKW~7(3Kwx^|eF$ud-JsEXo~2RbWZ$i0N*E=S*!*go
oHhkJSBEcDL2Dct<cw`?x_b2pENgk-r{1#&lw+(jT2#08UzY5KikpKVy
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/label-003.js
@@ -0,0 +1,15 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+// The colon for a labeled statement may be on a separate line.
+var x;
+label
+: {
+ x = 1;
+ break label;
+ x = 2;
+}
+assertEq(x, 1);
+reportCompare(0, 0, 'ok');
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..534a34d9f608434588c5e633db0e9f92248e2941
GIT binary patch
literal 1309
zc${64`)b=T6vj1Sf)FN{U_uC85T%5WW+Cmmb}&YBsoP~VS&7|lkZnbE)I`j&gRJzz
zVC;4FI@^o%5vE*h*YO|r(eFF@j`X?R?SHhv@NCfP^;&~(e8hao<>R|Qnf=B&mrPKv
zKc6zeUF%^cSQzrauXLAPx15OtmXp$!RI;gR+3HZwOZax1`y=j;lkN5O2wMuplg_uD
zU^)xt{-~vvV}Ie5hzALDs2DSu`0ZR#!Rd|1PMGUaL1iGyn@BmB_C1&Gq(ehS)S0Mw
zOx&Yew}ZfA)K3JW#xfz<NEzC0Fk|F25L4=1DAOrZd&2VR+;<oL&qf`rM#YhQ=5lhv
zZt2{Uy6p-+leNe<Hd?w@<Mf|LSX|ky9q{!+E%w=c(ou*G(GEtBrOWi?hPE^4_Rs9(
zKmUXEbs7!}rLOvvueSR>b4NwiwmMGtQy+7GHka7xI_H+o9%jsya5vY!JnLWf+SVX@
zWesfA_A6Za5cQrAKOi@P(H~)rxQm!se1?!v!H7Sf-l)jxge=Vo4@oYRRLI3KAkkm%
zy*WBOLQ<`a1zP;8iZfwkJtT|*g$>>6^jg>Z=1O_hXzY=Dp~CyX=!gj?I1k3?F5sh~
zGq9}W<{h+M)F8kphjdee2te=>m2(*#8VKRasxa}I=y-co<nWf3fdvTEyPAi2BX2;2
zi%?f<P}V^D`F-6?@u%Z;vB5!e{r#TiDB@q!+=%!^nwt^-vg8G=@M05y6v%7k)ViuQ
zY8!Wmx8j}Wpaek)fSrt%#Snm^3Isw`Ah3lsgi*Fyhu|m7<T6E-8jQ^d#D9?)FH2C<
xwQMXmBjxEhtr)QanrVf^3ffQ_%}N?Hn}^Vh4bz$mvIa>JL6kRe9%7h<@INC`HE{p{
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/switch-001.js
@@ -0,0 +1,65 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: switch-001.js
+ * ECMA Section:
+ * Description: The switch Statement
+ *
+ * A simple switch test with no abrupt completions.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ *
+ */
+var SECTION = "switch-001";
+var VERSION = "ECMA_2";
+var TITLE = "The switch statement";
+
+var BUGNUMBER="315767";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+SwitchTest( 0, 126 );
+SwitchTest( 1, 124 );
+SwitchTest( 2, 120 );
+SwitchTest( 3, 112 );
+SwitchTest( 4, 64 );
+SwitchTest( 5, 96 );
+SwitchTest( true, 96 );
+SwitchTest( false, 96 );
+SwitchTest( null, 96 );
+SwitchTest( void 0, 96 );
+SwitchTest( "0", 96 );
+
+test();
+
+function SwitchTest( input, expect ) {
+ var result = 0;
+
+ switch ( input ) {
+ case 0:
+ result += 2;
+ case 1:
+ result += 4;
+ case 2:
+ result += 8;
+ case 3:
+ result += 16;
+ default:
+ result += 32;
+ case 4:
+ result +=64;
+ }
+
+ new TestCase(
+ SECTION,
+ "switch with no breaks, case expressions are numbers. input is "+
+ input,
+ expect,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..49a1cc58796e480f796850faa66f7cefa25e36c9
GIT binary patch
literal 1250
zc${5P+iKfD5Zw+!6+#$cj4{HP#ROxVG?)-VX({m~O5)<U!BW$QP{Kyq*h^)}tk${E
z$9`P@pg+(b$RD)pizLf>Sk0U{=giJ*Z!r4opxcXa_v)%U{?2?F3MO7Y{#K9MLnbIE
z!Dum~oO$;1oYOdFQP>=;SPzWy3~XefBZ#0gNvZZp5M+40$3mZllT3cNY2gSi@r?Pt
zAI;{`BJ{g5orFuTtazM(F5wd@GQX1Z#Dq8PlbG(^5YEVbK+mWb5KctI8@rG+!}3mq
zzhv&!9;f6-Is%r>C>PY1TE~m#G}%foiULZ)OjtQzgx=D!7x^!ZB-v_pkXT(yU`D0O
z%Fu8;&gKH2M|?(tv=$$)XGw4Jjfv?QeIScKw9=Q^Uaz$lY&iPevTBX!Q^u%$&Ch!4
zxZ}a-!pWZfCmd{c=+amik|(W{{Z9qQ?z@98BlVGRorUv-(A|MMv<><^r=EcQ!i_z4
zBtiLydhyBt%X5mu2;VOk8h^lerNb=7#aIw7RvqmARrl_w=}sx$$l_#Rb4ge}r6y#6
zpST?Qk`kYCHyTD0XlsuV^Gj>lyLS5s@U1(x?QEL2+McBV(p1$bDxe}jf7N<PGoYxc
zdUG8Vb!#0MdR0-O0!W_qGL+4-398-#L*}TVpq;PM$>Fc3o50NDsI&PG^SGAamwDVw
z@aq*`QL1keqXa-XpsciVc}qEJ?A|qz>U-M&280o+t4cu!ge*BYfDAO$&=pPB3Wqg7
zzd$W%mfQ}cW=+ulXl9z$Krxg;TJ9v3*VDSPT`@bAQmX3YRX9~?JC%0lAaB!=HYZ@F
Vrg^$tS{rJX25Q;V%b-I6;6L24Di#0$
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/switch-002.js
@@ -0,0 +1,63 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: switch-002.js
+ * ECMA Section:
+ * Description: The switch Statement
+ *
+ * A simple switch test with no abrupt completions.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ *
+ */
+var SECTION = "switch-002";
+var VERSION = "ECMA_2";
+var TITLE = "The switch statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+SwitchTest( 0, 6 );
+SwitchTest( 1, 4 );
+SwitchTest( 2, 56 );
+SwitchTest( 3, 48 );
+SwitchTest( 4, 64 );
+SwitchTest( true, 32 );
+SwitchTest( false, 32 );
+SwitchTest( null, 32 );
+SwitchTest( void 0, 32 );
+SwitchTest( "0", 32 );
+
+test();
+
+function SwitchTest( input, expect ) {
+ var result = 0;
+
+ switch ( input ) {
+ case 0:
+ result += 2;
+ case 1:
+ result += 4;
+ break;
+ case 2:
+ result += 8;
+ case 3:
+ result += 16;
+ default:
+ result += 32;
+ break;
+ case 4:
+ result += 64;
+ }
+
+ new TestCase(
+ SECTION,
+ "switch with no breaks: input is " + input,
+ expect,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..b3d56682916c7a7fc7fbfe8be1f0170482588af4
GIT binary patch
literal 1013
zc${65-D=w~6vq#mFvb{Tf(gNdAVLTs?Mms&DBTB3QnyWMvk{x_qKu;0YGUTtK~|ci
zZ?T8mL+oyHY}aEq((ioz&(X1m<H?N+4_DK{-Q8gNBMew9Lb3bs2ltO|L%}$WT*1S5
z?rc|_rD>SN-3nbn1zXCJ-gsa56f#~#n<E-Um3cNwmaAkP2Lox&<E*R-o>oqe@;MWg
zV0#$Gft;Z7Snehi{$fN^*1e}Zq_c=!Fh8Q43aQok-<NPAH7MUz{fO+xxL|?Ib^T<;
zbl2zMN@$Ohbrg}ygfD6IO%^YiTteEtT*rQ<{ZE@l=^G}&?ld3ibs^tFvAAGQbR7vh
z4;9v7+4xm_-`<|EO*P$v>rKa#E4TU{ztN2@gHoV)yvI_34?Y>LGxEk?C&*WxDc8by
zwH9cGc4&hr+M)xUZCA_}=tc9!-mRnd>C89oovEAE5a@XeM$)|?Nz2)d-FB1ZS$W{?
z@$tKw404h6RE0dujI#A>`$Y6SEHvb~AaO!woY9}@IU)OjNSG27kPVkV)HS04<6d%`
z%u!#F#pX-VPR}na$r;@Z9#0;;spC{D_=OvFjF74*tu{sqAXs8zYC5Xv3LNIphU*+!
z&_fD7LLkqNb!0WH23DYhThc}v1`ECvWWZ%XDyRjW11aeJE7jn%pgLR>WJ157CJZGV
zBWMA16>RGWppF2`0RVK=)UdAWwoMScK}tTNOl)I)rW(*R<+HE`&@{j-*)*VDa@~Mh
l$+b>NpKlZctkSX!FiJKIP)k-(51-g7R;&h`VIA8T{sJ%X2K)d3
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/switch-003.js
@@ -0,0 +1,57 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: switch-003.js
+ * ECMA Section:
+ * Description: The switch Statement
+ *
+ * Attempt to verify that case statements are evaluated in source order
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ *
+ */
+var SECTION = "switch-003";
+var VERSION = "ECMA_2";
+var TITLE = "The switch statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+SwitchTest( "a", "abc" );
+SwitchTest( "b", "bc" );
+SwitchTest( "c", "c" );
+SwitchTest( "d", "*abc" );
+SwitchTest( "v", "*abc" );
+SwitchTest( "w", "w*abc" );
+SwitchTest( "x", "xw*abc" );
+SwitchTest( "y", "yxw*abc" );
+SwitchTest( "z", "zyxw*abc" );
+// SwitchTest( new java.lang.String("z"), "*abc" );
+
+test();
+
+function SwitchTest( input, expect ) {
+ var result = "";
+
+ switch ( input ) {
+ case "z": result += "z";
+ case "y": result += "y";
+ case "x": result += "x";
+ case "w": result += "w";
+ default: result += "*";
+ case "a": result += "a";
+ case "b": result += "b";
+ case "c": result += "c";
+ }
+
+ new TestCase(
+ SECTION,
+ "switch with no breaks: input is " + input,
+ expect,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..80b612075cb582935f3e2de7686c07fca3cc8a3d
GIT binary patch
literal 1694
zc${rg|8Ck=6uv#WvMkGD7P1gR2wfqB5M>cfSwz!y83vP55vRf?otjOR12>5^W20-+
zG|#c8*;{2#uwDPSm{jv0*7tqq_c_;?Ss!e4eZCl7T#OcfcxxKOUi|p>AL*nsOUbQA
znfYzYXcT#2a5VQ~%3R-$nHSs@db@yj?8bD%LkA<y?}7w6F1w>~k+42?eZL5)8;rVt
z?gNM8aI+0}!MaFL`0Dn97q9NeZbWMqeJBk5yftgLq0CzqhNj^KYu;^9Ubq@z=u<a1
z7~{%io_pid30?Uvb7QWxzSlz5`M<^pFXOVu1A%){7SlCPV6Vb0RlZm|->+o@Oz5q<
z^W(<yc~E=03sy<lgAP=C#k_4yrXkz7{ztBEDDOY&?k7H6W>1veJEp~}BC!#!9|u_v
z`;C9{V$smG?JQ>2xm~=4zwqxW&&_T5?j0J%_+NxyzJn1M(pQ(2@=ca(bL`A6t<pM6
zrt)LlP$oNzr72s>`CPiROl3Nn+h%!bP0Z=cGAHt9b8!i-;sx7X3^!`_wiIXP%uSVk
z+tO7GFO^%@k7()2T-ZFn9J3vTSI{pT%X4daVVDa&N_+dU-+!$I^noNLjZ7o_e@}vt
z+$7H|Iwd46MZAb;$t=lRN@J2nkZO)EMqiFgiNL$<IQNv~c_OhdIp$&V*U(#+xyIro
z3y^XWk`6~67(dN>>aHns!g+Y7zJB%7o8j=<S(s+A*>`G}V1SY;E2mobSe9f(Lx6rz
zCskF2ny$gm890Xb8R)`11E=sA%V+_J|9`7M<EU|jG;mNC*QJ_<bREhl{hrRaLJk##
zs%nL&kTuki0OX7*8B@4-MMEVCDla&!XAp7NXn))%;Iw+gD|2^5faItO)f_dTk)t})
zGgLv)Pf!)_v%oNSszBwL>FEqka#IazdHf3)WC)tj%&juWxz>hut||P-k&g2zpnOPC
zLDS(g+QiQnl&Th>4nlni_gaAXm<R(u4$`5gV7;aHn#X|t#!_|<1k(ZHek~niRg!oH
z1z+P<37SG^D!2q~!P=Z5Sui<aieL(7dGkX0WiKHiT_rJ9!Kw*s2-e`N2p%MCAJ<Pj
zD}q%LRu`<!*?tK^92Vl!nGjFXh7NZoER*jnMa+k!R!y*4!iZo*!TbhBO-5Sd2!2H^
H)I;b$_*`n}
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/switch-004.js
@@ -0,0 +1,94 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: switch-003.js
+ * ECMA Section:
+ * Description: The switch Statement
+ *
+ * This uses variables and objects as case expressions in switch statements.
+ * This verifies a bunch of bugs:
+ *
+ * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315988
+ * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315975
+ * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315954
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ *
+ */
+var SECTION = "switch-003";
+var VERSION = "ECMA_2";
+var TITLE = "The switch statement";
+var BUGNUMBER= "315988";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+ONE = new Number(1);
+ZERO = new Number(0);
+var A = new String("A");
+var B = new String("B");
+TRUE = new Boolean( true );
+FALSE = new Boolean( false );
+UNDEFINED = void 0;
+NULL = null;
+
+SwitchTest( ZERO, "ZERO" );
+SwitchTest( NULL, "NULL" );
+SwitchTest( UNDEFINED, "UNDEFINED" );
+SwitchTest( FALSE, "FALSE" );
+SwitchTest( false, "false" );
+SwitchTest( 0, "0" );
+
+SwitchTest ( TRUE, "TRUE" );
+SwitchTest( 1, "1" );
+SwitchTest( ONE, "ONE" );
+SwitchTest( true, "true" );
+
+SwitchTest( "a", "a" );
+SwitchTest( A, "A" );
+SwitchTest( "b", "b" );
+SwitchTest( B, "B" );
+
+SwitchTest( new Boolean( true ), "default" );
+SwitchTest( new Boolean(false ), "default" );
+SwitchTest( new String( "A" ), "default" );
+SwitchTest( new Number( 0 ), "default" );
+
+test();
+
+function SwitchTest( input, expect ) {
+ var result = "";
+
+ switch ( input ) {
+ default: result += "default"; break;
+ case "a": result += "a"; break;
+ case "b": result += "b"; break;
+ case A: result += "A"; break;
+ case B: result += "B"; break;
+ case new Boolean(true): result += "new TRUE"; break;
+ case new Boolean(false): result += "new FALSE"; break;
+ case NULL: result += "NULL"; break;
+ case UNDEFINED: result += "UNDEFINED"; break;
+ case true: result += "true"; break;
+ case false: result += "false"; break;
+ case TRUE: result += "TRUE"; break;
+ case FALSE: result += "FALSE"; break;
+ case 0: result += "0"; break;
+ case 1: result += "1"; break;
+ case new Number(0) : result += "new ZERO"; break;
+ case new Number(1) : result += "new ONE"; break;
+ case ONE: result += "ONE"; break;
+ case ZERO: result += "ZERO"; break;
+ }
+
+ new TestCase(
+ SECTION,
+ "switch with no breaks: input is " + input,
+ expect,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..ddf85c6690cff54cf599cdcaf1d42162043d46a0
GIT binary patch
literal 1290
zc${TY?QY^m6umndjYgJ*5Q-2&6irct*lmikDP3(pw?Le%qu^H9%b#eACT0M)#*W5A
zvPk<reUZLG-(&j*y$%T`-T7gkd+xa(bMFjX@4|<x^KpMP>W|+?GnJUgY<~EMz3#a8
z#ynEm`Ea9EmPKjOE}(CuQ7e=*hBA%|zBP!FS(Ge_@a|<~l$Nn?H1dVgntJOv7O0nc
zQ_#l`a&Ns-ItusngE$TUJe)`!$?I61sxX#XnpC&{PocQi$CyQuHyB90P^RdoQ@B2_
zI!M!4$)s=yR4Z-N42$?-dZTJ*>m<xe4AR-A?y0-I@jSZr8WCryUdi}3G*=2sWJiw)
zchr5_=DVk3u>DX+H>T>&cauKKQ525U>Uw`EjbN$MyPc{zR%We>{Zxn2gv((p*O_Vu
zdUJ;Jj^oYFf8_^b*E{!%?f*qDtXmncRSV^K!3%jS-NdMc(k0&+2JWvO`Ksr7lm4Z9
zI=$#m`cu~noO5S9Me3cyZl$iw^D=?TOe1-c!N#uFv9Z;M8x<OIYXxp_>6G0B1F$$z
z<m<<XN!~+8lqSyD$C~9l+fZhTdD0Vi8W;9f$(hnYdYLZxNSdWJkJD6JQHF}&-2^WY
z&BXmx#5~pF4@}yPWwPi#G$X<^$&6ly_=@c9`)mbEC5+yP>~TOubi{M9jEtCXM<=fH
zhiE&)QGa@3<2%K5R8X!>-XYMBAL*ArmA>h|?7jT<J8qDp;`voDcAR3yU$7SqMoG!y
zoK^*AoR)yVzqEN^*`&fK|9J}pf4v1&enKexNC3a>DzTZ(fbt$xw{Fh6=pYv5r@*%e
z4!5X{sUOY`<b0QQ8V|&$H+%3&%%?X`c+6UZ8lp1-Er2#92L!-kr9(#8fz>2%O-Zc^
z6uxH!4vy?!>;dgU=LK4LC>-UWY;kf7JpY}*eI7<DK+)46__Gl(a%fQotdi&an{O{^
y*Wp#!su8SErclaL^;o@Nj*&sLl$&<_84=KGaiICEcoTrXg$k5EV_(&uf&CxifL$#B
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-001.js
@@ -0,0 +1,83 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-001.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test contains try, catch, and finally blocks. An exception is
+ * sometimes thrown by a function called from within the try block.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var INVALID_JAVA_INTEGER_VALUE = "Invalid value for java.lang.Integer constructor";
+
+TryNewJavaInteger( "3.14159", INVALID_JAVA_INTEGER_VALUE );
+TryNewJavaInteger( NaN, INVALID_JAVA_INTEGER_VALUE );
+TryNewJavaInteger( 0, 0 );
+TryNewJavaInteger( -1, -1 );
+TryNewJavaInteger( 1, 1 );
+TryNewJavaInteger( Infinity, Infinity );
+
+test();
+
+/**
+ * Check to see if the input is valid for java.lang.Integer. If it is
+ * not valid, throw INVALID_JAVA_INTEGER_VALUE. If input is valid,
+ * return Number( v )
+ *
+ */
+
+function newJavaInteger( v ) {
+ value = Number( v );
+ if ( Math.floor(value) != value || isNaN(value) ) {
+ throw ( INVALID_JAVA_INTEGER_VALUE );
+ } else {
+ return value;
+ }
+}
+
+/**
+ * Call newJavaInteger( value ) from within a try block. Catch any
+ * exception, and store it in result. Verify that we got the right
+ * return value from newJavaInteger in cases in which we do not expect
+ * exceptions, and that we got the exception in cases where an exception
+ * was expected.
+ */
+function TryNewJavaInteger( value, expect ) {
+ var finalTest = false;
+
+ try {
+ result = newJavaInteger( value );
+ } catch ( e ) {
+ result = String( e );
+ } finally {
+ finalTest = true;
+ }
+ new TestCase(
+ SECTION,
+ "newJavaValue( " + value +" )",
+ expect,
+ result);
+
+ new TestCase(
+ SECTION,
+ "newJavaValue( " + value +" ) hit finally block",
+ true,
+ finalTest);
+
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..c21b5aabb4de04aa3716855acae5caca472edacd
GIT binary patch
literal 1229
zc${rfk4xJ?7(I^=LMWjW38jb}LBu&%JAWZgw>2@<xSC26WkZIX?b!y?T)AA;{vG>=
z_ci^IZb(S-?z?yId+$5j^REJQf6=aAU)S5eqb^HiB*$OQ)LOL}NhW9<ND(DH_iZRx
znnpa?@-os>#6(`)%wZs@WCNh+5B?~Qbvx#rXJSVQ72_q9I{bRcgqIgBV0EEc-r*pp
zg;eyI%(vDY8plfx?x=|9W6aK3C#Hf*sBQdT<D%lT*ZfdzmeJ-sW;9t+3&pqrmg9K5
z$YXj>3%mion2@ZSr3*TI$jH0|O|ydOP}%7_F&(9BXTEs@HU<ouW|YmwDCta`E}13`
zE(SDS5YzIUWb^L05OhQ|l=nf{_WX+=zp<8T<Bvw*I-%F{wVQentg=O%RXzfx%ugAT
z1ss(7FlhCKilXcb{t63)d?;tUS@2@WQt8l?>7f@k-2!`|@fImZNwT1n?Ar_f_S$ya
z#+};^ptF&wk$o%dGa|*9r1Oy#-^dxU`jK_jsC&&5a_*fIzZH^8FC?DtyKU0&{Cczb
zi`dPU^Mkw!xSLBxyG(?<$$OdvJ0*}4a$+p*OF2B*-A!SRqqI8c@Ie*c-N#Wc9mZ7d
zrhWeU0IO=J7k!JmXZxS`504Kq!R%;iVA8mC8$x5J9y*uPwguO@u0QM<VEt3Awx3bm
z^Am7N+@FqnGnp>%Z!a#xcXCYS{>foZ2Vy;PZfTPd-iK}1&F}4xQneJU>)IMN*A<Lc
zFd8W4YN3El1Eb?9SVu=wU?OV@)=*U`;T??NyJcb>=?G&~!zQeCT|pZaG(%r2D>Fng
zw2jdgLYu0hg8qty(d1b%^le=+RKrj~^BEgTp;$qi>)6nM1`7?HERX`<5;|SeNOtrT
z&ru13{&y8)Rh^N+#fGt`sWrSTr7Y0F43$8%j8`oUXHifYtEh++TzR*uy<08)1+c+M
Af&c&j
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-003.js
@@ -0,0 +1,82 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-003.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try with no catch, and a finally.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-003";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=313585";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// Tests start here.
+
+TrySomething( "x = \"hi\"", false );
+TrySomething( "throw \"boo\"", true );
+TrySomething( "throw 3", true );
+
+test();
+
+/**
+ * This function contains a try block with no catch block,
+ * but it does have a finally block. Try to evaluate expressions
+ * that do and do not throw exceptions.
+ */
+
+function TrySomething( expression, throwing ) {
+ innerFinally = "FAIL: DID NOT HIT INNER FINALLY BLOCK";
+ if (throwing) {
+ outerCatch = "FAILED: NO EXCEPTION CAUGHT";
+ } else {
+ outerCatch = "PASS";
+ }
+ outerFinally = "FAIL: DID NOT HIT OUTER FINALLY BLOCK";
+
+ try {
+ try {
+ eval( expression );
+ } finally {
+ innerFinally = "PASS";
+ }
+ } catch ( e ) {
+ if (throwing) {
+ outerCatch = "PASS";
+ } else {
+ outerCatch = "FAIL: HIT OUTER CATCH BLOCK";
+ }
+ } finally {
+ outerFinally = "PASS";
+ }
+
+
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" )",
+ "PASS",
+ innerFinally );
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" )",
+ "PASS",
+ outerCatch );
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" )",
+ "PASS",
+ outerFinally );
+
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..024659161a4567a47f6c5d85db6fd0018210d08e
GIT binary patch
literal 973
zc${rgVQZUE6n(us9wH(VLI_<bA|a$*7D8!9S;tu7Z0BgQ5~W|tD6i%&kr@rom$vym
z`!)Mld)lOyF$6vL+;h&mULE<9ZvnZzoDRq1;q*s5!&Js{bAHYSUB4`T#wfg}mB2iY
zv$TH|OB6f_q=?gb#dj(gNG@@ytj;J-XG&G&v|OGfmC{xME;bdR-%Zv@(!Sv$=JyGH
z!6@N^%S?3srIfgNu}-4`jI!CrzR1LqC)cXCL^WZqkCH6<We@Wlg~XZi2T``dt|H=j
zT8#H<_+8Sg^xn?-5?T6BDu2ku9A))#`xAVuGTS?UIY;R=f=I+G*$NjTdwkhauRw7$
z#^wF%MK@e7qlKIBb&gIbHf8x@x(&jqKe-I55B7$Bg12=g46{;d2A&)G-zWM5Pu8f1
zet6}v2QCbizfPoqPb-WhJeW7$G*CJ~vz!Zs6E4t}Vq@pK)66lKi~hA=Q;d)y=E|;O
zySDu()bH>W`3yyvU1f7ks-{*nKX22zPM$5%7CfD0OB<geTovne4#C!nSkvX}`9j*(
z_IYY}?s#~2T;KUm53S-vm*+^Y{j;s?zoFDVG}Ykm27{B^aO!#0cK$%8$!G&KMztCR
zx(DPpG%Vc!lTrBi3~DfV1{yS}Mp{7B-EM$RbV4X}iKc2WDeNDSqxS{YDI7z8i#l+o
zkOQPe$N>cl2r*cr&VX4)4TuF@oj{LRMVnER0oiK;DXu*Rb)7QC%t9z=ztJw~CeVG`
g&`4WpS&!8lhFLPCP91XMXoMD{!2x0LftbYj3!k1DWB>pF
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-004.js
@@ -0,0 +1,54 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-004.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try with one catch block but no finally.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-004";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+TryToCatch( "Math.PI", Math.PI );
+TryToCatch( "Thrower(5)", "Caught 5" );
+TryToCatch( "Thrower(\"some random exception\")", "Caught some random exception" );
+
+test();
+
+function Thrower( v ) {
+ throw "Caught " + v;
+}
+
+/**
+ * Evaluate a string. Catch any exceptions thrown. If no exception is
+ * expected, verify the result of the evaluation. If an exception is
+ * expected, verify that we got the right exception.
+ */
+
+function TryToCatch( value, expect ) {
+ try {
+ result = eval( value );
+ } catch ( e ) {
+ result = e;
+ }
+
+ new TestCase(
+ SECTION,
+ "eval( " + value +" )",
+ expect,
+ result );
+}
+
+
new file mode 100644
index 0000000000000000000000000000000000000000..dcfbca25aa9ceb8b7621c5fbf17e79deef2d5c53
GIT binary patch
literal 1004
zc${rgVQbqk5LGoHj4{T95JCt=m@cGU7D8!8*~Vz%xt&LomDu!48AWw&iJ4;uS#F!3
zx_>j-P2w_!vF~*E-n%EsV{iK1M|W4V(PT23{fy?2$VhHJ4e6lkm5W~y2={p{Aj_gO
z>0d_@1dn|wqGVCk?QxXMRi)x|s-`cwgq3Qv9UjM3UB92^am*Bzi%nJTjj{}cg!v5@
zd<ANrAEs;Q+;S1|hZw#>7^{v{P<EM$6_5A8taF(sVbOU7I{KHGislYBPUoAhninmS
z!r&`!<2Vg}pH;1Ziv`GPe{APcsh9rR!BV78`@J5{K<1*_dus|$mAv7HB3es35F3Zf
zaJh#y%B2(YJcC|Qjlv169$w$Uogd7+>6KsI)?0FcAMv}oQVY^j!1P@w@P14+_mRiC
zdUK$UTo_6skEI@X!L@6^^BO{FmcBulx9-eW6bytN8=yE{cJA<ev6L)JSHJ{M=IM&T
za|r9=?CM)$cX(XOBo{J(Op+T9Gi}1<QY$1(DK_s1gQ2+<vI>mDGhk0b{Yl?|&p`y~
zb-FNIXEM4!wSy%vMPk|RL@st??Ekv3kFBltP?JjBEN1s_yt`oLy44ZAAzh|Xtxhyb
ztp-)$0HZ&+X&DA?5Q=**Ndup~Bo_WaHDqI?zNZars0UHpL6%w*li)9X)IBP4onVGP
zZnJZIsIt!()e%x4gb~t7y+$!XdJ`iH+XlvcRJ9LS@l}y%dsGb{Y3PLF7Z@cqy_8Xr
ss2Q~avLq*M6>00x)R3m2dXF^Qx>;6GlXlR+)(|aR<2KT93)PVM7aEfqsQ>@~
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-005.js
@@ -0,0 +1,57 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-005.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try with one catch block but no finally. Same
+ * as try-004, but the eval statement is called from a function, not
+ * directly from within the try block.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-005";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+TryToCatch( "Math.PI", Math.PI );
+TryToCatch( "Thrower(5)", "Caught 5" );
+TryToCatch( "Thrower(\"some random exception\")", "Caught some random exception" );
+
+test();
+
+function Thrower( v ) {
+ throw "Caught " + v;
+}
+function Eval( v ) {
+ return eval( v );
+}
+
+/**
+ * Evaluate a string. Catch any exceptions thrown. If no exception is
+ * expected, verify the result of the evaluation. If an exception is
+ * expected, verify that we got the right exception.
+ */
+
+function TryToCatch( value, expect ) {
+ try {
+ result = Eval( value );
+ } catch ( e ) {
+ result = e;
+ }
+
+ new TestCase(
+ SECTION,
+ "eval( " + value +" )",
+ expect,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..c957b24c33fdbbeb46ea45699b3ec66c42afa602
GIT binary patch
literal 1213
zc${5Qe{0%67``1xc7zauh)56#LBw^gNGYYbF{WwSIjSutbcHg?HC{Dq%*o|!>nGS(
z*%#RN+g<z-=|6dYKkxHCx&C1EBLH_7<KA%C8~=(YG!?N}eSVL-twA0<#+3W73r@2v
zW~tkc(@C68i<*8vS|&-eXbA)nbS}$>m$9InB!S>^qG+gjBuR?Uk&uM1ibSg?%`{aI
zdqd$Y&Wf<Dw#3np&L8&aHE#%y$wNZVXp|5xTV(EhnMTUl%QfEiF>a6OO96Dck6-W!
z37=BooHITr$+aAuQ+Z-m-LB}f$x81hEP6VAJ5(svmL<vso$LUDh%IPmBUhiXgp#!2
za^Nwkxq>HqvQ<1HqM4VFWk%~`Dwe!Z-u@Yj*)EdOarUwcjUeLjLbxGc<q*4qv*jhl
z$r;@R;dn5*2#ROnp)>f=U=P1(Buex(q6<aK416yfT#fW+k}Rp2f3F@L|JL)bRsMdB
zQ<596@=;TIilX*RcugpF{uWCQ2jQh(N!c!=JuXv29=%M2dE<`*wJ4g==m~WlNc9;_
z5@v0GKxu>Aa;%VM!Xp`lj>~g-93h|3Va^WESV9cn8}{yxoEI*I|4zw-@{nD!DRMrT
zg0DVxIw$Uqg_F}vyI4rrQYHu&YJnThs3V)5Y^&m3IQIQQv480JRL7=OE$i6ODs>GR
z8i3#rvdbj{R-uNwYp0Hn*G>iZH646|Kz>gu&;SMi8a@P-3IGVfavcKXK;XcmykuZk
zFIhSS>uCdjS@%^peHJ`i*Cm`)g*Grv4L3o#^=?0L1gb67@f89&-ozTRF_bvateYCd
z(1u8Xong(aSs3I70i=v>gO+URDBl6L8b=W3!&Y6Bo*Mj%PF&=|4uCEyL(Oc|ba?@2
j!-k8@JO&NT2JKr6G<6m}C;^D^sWPaz6F_;$#(>&?knK}s
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-006.js
@@ -0,0 +1,87 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-006.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * Throw an exception from within a With block in a try block. Verify
+ * that any expected exceptions are caught.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-006";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+/**
+ * This is the "check" function for test objects that will
+ * throw an exception.
+ */
+function throwException() {
+ throw EXCEPTION_STRING +": " + this.valueOf();
+}
+var EXCEPTION_STRING = "Exception thrown:";
+
+/**
+ * This is the "check" function for test objects that do not
+ * throw an exception
+ */
+function noException() {
+ return this.valueOf();
+}
+
+/**
+ * Add test cases here
+ */
+TryWith( new TryObject( "hello", throwException, true ));
+TryWith( new TryObject( "hola", noException, false ));
+
+/**
+ * Run the test.
+ */
+
+test();
+
+/**
+ * This is the object that will be the "this" in a with block.
+ */
+function TryObject( value, fun, exception ) {
+ this.value = value;
+ this.exception = exception;
+
+ this.valueOf = new Function ( "return this.value" );
+ this.check = fun;
+}
+
+/**
+ * This function has the try block that has a with block within it.
+ * Test cases are added in this function. Within the with block, the
+ * object's "check" function is called. If the test object's exception
+ * property is true, we expect the result to be the exception value.
+ * If exception is false, then we expect the result to be the value of
+ * the object.
+ */
+function TryWith( object ) {
+ try {
+ with ( object ) {
+ result = check();
+ }
+ } catch ( e ) {
+ result = e;
+ }
+
+ new TestCase(
+ SECTION,
+ "TryWith( " + object.value +" )",
+ (object.exception ? EXCEPTION_STRING +": " + object.valueOf() : object.valueOf()),
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..13f4fd8510148cf89a6301654df838271a13f27b
GIT binary patch
literal 1317
zc${5Q?P?lL6h0k>WmuL)L_|bn5D}Z&AR)BDrloPaX)Mtcci&P-OPH)<+;-iOact_P
z^jiA2H`BZ5%o<(aAUbEx^Km}L{$TVWfa~|;v*GY;{578NRK;rj>KEy^2iavBbLszF
zNWNUgBDHTut0Zak<8%_IcR8b#Qv$^lpKIXoGFDu&Bv4Xwa{|?BCf9kQ=CLH%yN0uP
znO{4`Fph?Ne!JgE`%E8qsVTH)eJ<pjB_Ek&bFPaoE9a{;QX1)t$-4E4$(Y?H{2h-H
zO)>eCefQilWb%%y=3{}7c0Uo(_tw^S&*}KFI^Rxp#P9PayPlXYR*Fv^kJQl)Txwv~
ze-McUuaCJ}$$YQfhrRZNNH|M#y%R(-UMRY?(cNbTdZAL>@AQpOu05ur*)DV73H_dC
z2)6eQ<-v5vXl@7IgEJ2=VXGyt>Aer~4(tE@|ADWAa6A~j5Ay%l5MMar_8X5BdS?G%
z$%?yy?}dY_5%oWN{znttY*a=5GvW(VyPzA-3Key5m8q>COxocfy!30z4C!yVXyInI
zS5rqfu}V}q6+6(Hu2RHtkGh}yaiB{bhcix<T+`)tgdU|+A)m)-QKzH|`BFJ*z2IVM
zM>8IMw`V*_gsU~ryWN*$CK6VdKJ3Wxz2Vu-5u%trEp2;l(}FSa*plPduN%8wXx4Yy
zBTA$6Uh22K;B3NWC@#g_bvX9@d~JX6Vb>;(TPxXwSjDD=i3JFL<7%bgpc=MFcM~+p
zi%n1@Ez5y60{welMz;QdMNXhd0T9Ba5&~34K+#bK5z=r9ZUw<cO-O&kt3B`v=wO3u
zJEwx0;JOw$gi`0pe&Psf9m9C1jRD%kvg;UWAMBP~3u9czwlVvnN2t0OusLk7&C!9n
zIVwF<7Clt8(Luq*#!A~{Mo!5>IK%$n<2o9lH;pnt9i5^R`|aC<766oq2CB#^HmXi`
l*V0o=>&VS=K&>XcxgcPf!O1BA>Affb*xNnm7@IFt{{e!DbR+-(
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-007.js
@@ -0,0 +1,92 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-007.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a for-in statement within a try block.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-007";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement: for-in";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+/**
+ * This is the "check" function for test objects that will
+ * throw an exception.
+ */
+function throwException() {
+ throw EXCEPTION_STRING +": " + this.valueOf();
+}
+var EXCEPTION_STRING = "Exception thrown:";
+
+/**
+ * This is the "check" function for test objects that do not
+ * throw an exception
+ */
+function noException() {
+ return this.valueOf();
+}
+
+/**
+ * Add test cases here
+ */
+TryForIn( new TryObject( "hello", throwException, true ));
+TryForIn( new TryObject( "hola", noException, false ));
+
+/**
+ * Run the test.
+ */
+
+test();
+
+/**
+ * This is the object that will be the "this" in a with block.
+ * The check function is either throwException() or noException().
+ * See above.
+ *
+ */
+function TryObject( value, fun, exception ) {
+ this.value = value;
+ this.exception = exception;
+
+ this.check = fun;
+ this.valueOf = function () { return this.value; }
+}
+
+/**
+ * This function has a for-in statement within a try block. Test cases
+ * are added after the try-catch-finally statement. Within the for-in
+ * block, call a function that can throw an exception. Verify that any
+ * exceptions are properly caught.
+ */
+
+function TryForIn( object ) {
+ try {
+ for ( p in object ) {
+ if ( typeof object[p] == "function" ) {
+ result = object[p]();
+ }
+ }
+ } catch ( e ) {
+ result = e;
+ }
+
+ new TestCase(
+ SECTION,
+ "TryForIn( " + object+ " )",
+ (object.exception ? EXCEPTION_STRING +": " + object.value : object.value),
+ result );
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..f59448ef9d57371ecd455806db4fdc6fc21bf536
GIT binary patch
literal 1231
zc${5Q?P?l96rB#kGAy!)1Q8KC4MD6;L?ncerX^}N=@#7<cauL!8z$?h)2usTc1$7!
z`Uw5gm*{Kso!Z}>)##e;7x$hy_nxzNrtP>NJ#cZ_Z}obu{ue%Ak>YCh_9Z^7I`d@6
znY15nC5vM&qDmTiiYhkIl+8Ae20R+2e4-I5XDPSd<%&rfdP-_yiknyNGz^O_yHBxF
zhlXLAHl9k`LWGP)>B4qmfCoJ`xn6g;bxtLx*C9J*K}aQ4LRS8V5*2^U<257gPy{zi
zEq6L$k_T(QeKL)Lq-?Fjb}NpVRBZ5B0~4kTy+GWu{dHTK!beduB%jI=Q{+U*2@O{j
zaW!S6YK5g*TMTAoDWiX4E>P|>HI?c3^UiP;XS_i2TU9=LKK^`%s$kp+=`?1wj?lZ6
zbf;@m*5i=kKHXAZ&gL~M<ihj&j(h5*N8|#v%{v-S8GK_okzykzYmR%~>N>|)j_cc}
zcK=FeXSU_p9pCxn8h2D~1Y;K5oF`>D_7Je!#E9uTe%H3n?Y^gJxJT6(GIT&PcBj|6
zYMMNDscQ~HAtZWybp0_SO3p~U^mZ^$c|<4)L=-DI4fL*mbs}w#56Ijk845|h(K}iX
zX*8-o8D8gSl~^3ltj}WAp)rFb_r$9b^y;0_b(@w}+G#ZQb6Q-gga~)CPBi3^9*LoC
zl6$Go&<92bO!}fLMp$VQBCjv}zHO(|`-K`c1EGwG4V=vx$iM)C@2H$NGjIc8+*|}X
zTwDZMya_F^3xWO~=Aof)fN>3E%K#7qS-KjS2yN*XAj_;m@Dm*r%_4-A%>uAMM)Scg
z%BN5c<SV*e22_tQz)3^A4FEpc1J=B|feQfS3dysuVBoDp48es~X3KyGBubaCZV;oc
zJ8qN{8KCt_Nl-Kka6fHUG%?f?S`rmd3Cu5il$`@60teX_&z1mKE$uI&5^C<1{#Gx4
T{Qd)u7HkV?)rO8O@E(GH+R|F`
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-008.js
@@ -0,0 +1,59 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-008.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try block in a constructor.
+ *
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-008";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement: try in a constructor";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function Integer( value, exception ) {
+ try {
+ this.value = checkValue( value );
+ } catch ( e ) {
+ this.value = e.toString();
+ }
+
+ new TestCase(
+ SECTION,
+ "Integer( " + value +" )",
+ (exception ? INVALID_INTEGER_VALUE +": " + value : this.value),
+ this.value );
+}
+
+var INVALID_INTEGER_VALUE = "Invalid value for java.lang.Integer constructor";
+
+function checkValue( value ) {
+ if ( Math.floor(value) != value || isNaN(value) ) {
+ throw ( INVALID_INTEGER_VALUE +": " + value );
+ } else {
+ return value;
+ }
+}
+
+// add test cases
+
+new Integer( 3, false );
+new Integer( NaN, true );
+new Integer( 0, false );
+new Integer( Infinity, false );
+new Integer( -2.12, true );
+new Integer( Math.LN2, true );
+
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..788443385230d29a79af9215db300a391fd45ec8
GIT binary patch
literal 1295
zc${TYVQbqu6xD<f!Wa`m2qA<bN(fnA7D6eb>l@=WdES=Mx+6B-pp2qATH{T%ilVH`
zk9Z&Ui?)BZT{%r0`o37Y_nvcf?!6vOqIWU6d^0^cJ3E<v%4RaRnO*%Ivsc|o5q!?1
z3BTVNxmaX6-ydc9EX!}oTBj_=R#<rp1@9_aDm6IGtTaN!)&Qe~anKNERVMn5n5Ad(
z_ImfN)>tT2hTRi5ZgQtzCOa3xWa3)Me`TtK0U6*W^K4N<+K(aHG+r<B)Impjw(4wx
z9SQzgn_HpYLwGBpiN(>b#nMP3%#F0(Na^(J;p22Uqv69OMp`Q=^3q!~lJ`3ekBk&w
zw^Qtcpfpy_wl?Ba-^t!s!wQ^Bu`?Y%PEB@a`Gx~c7wEmIv`bU2ruSgQEof)0iCK+>
zP3K!&y$HujEElr%VV)_uEx~+^zTbwIaWb7mZ{qUj`9c1{e|g`8T1p=tSSsu5>n}33
zo#^~3{5THZCzJE&YRwDcaO^_*O&I>TSOs6_1+@mZNnRMKM>_nT$~!lLrgdI68}yP%
zavHAvZ6V}0!ZNrBr!nXT1zwu=w#<u6e#|S0T-dQ#$iSM_v*GXs>2iK=U|esdm`Ri9
zQ+?BmG?)LQG7D5c9G{(B9Yo1oa!}xl&47-JFw42%_s&1RcE5`!l%5OBtAI1sz1<i*
znCm{}PrbQRN?#_^Ff0fAlMIF)t2L_?-wT-6;Eck7F#3<Qs=klw*kj%Gg|mb8rNItK
zfQ~VOZyx~2L&#%CsIe{wti8T4HULDmfjg)YQ1%Kn+fQ~A&rz-IG=>;85$Z8Y>KG$L
zaitYdj6s3W21b2KDtk4Iusilq-5mrGpiqjNEsPwfieG|@z^~zTzP8ODK%TAhJ%VZR
zK(z(>)YX51_&zy2Za?Al0zc<;KuO>ux)0q!q2L0c+d9H~oK}fTqP=d5bWrClL!N7%
S^$=w*`+y^b2f%N5i2MOk$Z#3}
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-009.js
@@ -0,0 +1,66 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-009.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try block within a while block. Verify that an exception
+ * breaks out of the while. I don't really know why this is an interesting
+ * test case but Mike Shaver had two of these so what the hey.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-009";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement: try in a while block";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var EXCEPTION_STRING = "Exception thrown: ";
+var NO_EXCEPTION_STRING = "No exception thrown: ";
+
+
+TryInWhile( new TryObject( "hello", ThrowException, true ) );
+TryInWhile( new TryObject( "aloha", NoException, false ));
+
+test();
+
+function TryObject( value, throwFunction, result ) {
+ this.value = value;
+ this.thrower = throwFunction;
+ this.result = result;
+}
+function ThrowException() {
+ throw EXCEPTION_STRING + this.value;
+}
+function NoException() {
+ return NO_EXCEPTION_STRING + this.value;
+}
+function TryInWhile( object ) {
+ result = null;
+ while ( true ) {
+ try {
+ object.thrower();
+ result = NO_EXCEPTION_STRING + object.value;
+ break;
+ } catch ( e ) {
+ result = e;
+ break;
+ }
+ }
+
+ new TestCase(
+ SECTION,
+ "( "+ object +".thrower() )",
+ (object.result
+ ? EXCEPTION_STRING + object.value :
+ NO_EXCEPTION_STRING + object.value),
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..b98aab19f0ff5903e359cae205bd5455fa92f050
GIT binary patch
literal 1482
zc${rh(Q4aB6deXJh(QQpj4;NSAsAy)Z*a4rglxO(*i{-YiCipE3SkKoc{WiiOJ+1`
z>bHJVU;0h^wm-12cVx$M(g>tGbI&>Vo;#986aUWuUA>!~US6Kg{)*=!Rk2$A_8&R!
zP0G#Rv5?-^r4)G{XKA-u28t`O01CbKizL|_#pygwZ!6W{B3453#4i>?#!;m_*Z_f&
zAgJ=KF;9|edvprnHq|XcE^mdZO1HwhIIoz;<7~0aigaEnDv*wnEc)EncH`($EN*t^
z>3rZa<~NCWE24x;t}@wungUwW7x$H@_gouxmdOQA-h*NxV7$C>R-};@kFxoy`>@$5
z%HYJfT<wgp>+$LE-B7O1K#(M>?a8}iuA;kf!i!w=K_H|O^R0s*%9f%%6RMEa%VG~S
zn6e~TK_ug)f)kb5{g!qWgtLkNE~vhUU&+V<pGC5vdS4^4)MM0qkwZPOSA%<c^GQU?
z^|LK*Wo62E@y1ee72an$OjAL=aA^nLIGjv<cP{eMhCUYW<Jfzzv)5}AU4MH0G>2c%
za1vg4SkNy#DTMvOn*{(Lm)_X6Ig3*^NmC&ic(c6m<>~d|d3YxncwqU%v?t{js9Y~@
z^!L*9v#LtY%ChNm)km4S)5UWeq`wSa4muUAO4SK_PB$&o+Lfu`{G1RTW1b6kFX87n
z7kn;cm|bMIeJ~<^s>m>_fqkj8?kb#lUiGH_AxDSQG)zn^+Gy6>9g{#n82uouS+j71
z)ahWo=+NGJ(Wd*@LPLz;dE(-3tJ^|#`a5c`;RZciFPii<FpPcNLWG&Lk4$8mNMGN)
z;VyCn{Wb_Xe}r^FgEyM9N5}za@UG?+MjeC>sOcid#t0dNu$oC+;t-o4V-KSf6SsSg
zi(DNX<mg}{TL<V#6Sq;gVa!uVAW%>+G%b<~Bcod~=;YFfc7U8H`{;H9o-vw{5gB
zhR}Z9_)f6pBI<zOnze=g{R1E<pdtG)gob^>>P8#yCY|Ba4110?_=z?g!igO>O;m?Y
IF5Hm&9|AgwmH+?%
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-010.js
@@ -0,0 +1,73 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-010.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This has a try block nested in the try block. Verify that the
+ * exception is caught by the right try block, and all finally blocks
+ * are executed.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-010";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement: try in a tryblock";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var EXCEPTION_STRING = "Exception thrown: ";
+var NO_EXCEPTION_STRING = "No exception thrown: ";
+
+
+NestedTry( new TryObject( "No Exceptions Thrown", NoException, NoException, 43 ) );
+NestedTry( new TryObject( "Throw Exception in Outer Try", ThrowException, NoException, 48 ));
+NestedTry( new TryObject( "Throw Exception in Inner Try", NoException, ThrowException, 45 ));
+NestedTry( new TryObject( "Throw Exception in Both Trys", ThrowException, ThrowException, 48 ));
+
+test();
+
+function TryObject( description, tryOne, tryTwo, result ) {
+ this.description = description;
+ this.tryOne = tryOne;
+ this.tryTwo = tryTwo;
+ this.result = result;
+}
+function ThrowException() {
+ throw EXCEPTION_STRING + this.value;
+}
+function NoException() {
+ return NO_EXCEPTION_STRING + this.value;
+}
+function NestedTry( object ) {
+ result = 0;
+ try {
+ object.tryOne();
+ result += 1;
+ try {
+ object.tryTwo();
+ result += 2;
+ } catch ( e ) {
+ result +=4;
+ } finally {
+ result += 8;
+ }
+ } catch ( e ) {
+ result += 16;
+ } finally {
+ result += 32;
+ }
+
+ new TestCase(
+ SECTION,
+ object.description,
+ object.result,
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..4c497982ac19f217d8ed8e14074a1f982733ec07
GIT binary patch
literal 1330
zc${rge{0%67(R~>LXaRLA|mAoBChL-v!yHD4{Bo6bQ;CPu~A03>a~WYNx7VD{cG$4
z>~riB?ECGKXwn~32+uwDywCH#Z=#vjnGMeS)6QtrnSOT{#AhyBzyB>B?hjo?DE4ed
zUH{s6xTPcv-N0{}vFOSrG$R`sv>9gPhD&743+6xM3v1<hhaG-*?MJkO=`~@QNi)03
zOjOPF7d$qTA<kgB&LlM*dtP>|f5FtnmmcYoxrZrc0c|{|xU99AN(%yyU_Yy`TI4=E
zmCdVkj)p_mJs$3P>y)eWrU_+a5zlDPgIj{O6i<zbMsMZMqs&L~s29*1>`nObhVVwh
znzN+Aed=4;)@Z?Ez3tUn-4N=|v+nZtoVvHHtYbD`>K<N&WN(|ETE{({+s@Rq`gZna
z|B5~MTCok?F~^oP>DYFOq{bCKsvYq1CEtB1SaF*;L%hSZz@kn$Uy1q6MhXrInT|tJ
zaeY5!^W+YDO(Z*}Gc=0YtZ&UmnlV+r7*m_a<_`{zj^DMr=+y~Ak#xn!U!d3*T_qOi
zGTN-d==x3TZ5!QFzKa3D3qqY>7+gc5Mb%kx9RIYq9CwV=%OFsd1RqFI1w?s6A9XI;
zXT6R&JV9Nvi>$GO2Bw3?Gsl>so@sT4!*56%j`hzH<1-#5(oCXv9DR@oiXp?4MVlx*
zppQshx@s&px+mNh8DDi{60Mup%=!c8KdGi=Jx@J-I$yG!dGt1t>5%Fy3F7-f;r8n}
zcczAsz3M;0zA8XTma4E)6Clh%@JlF{^LbcOAW#!f1MLJ<KsNzZup<=V2?YFEFT(;T
z00=<~R`^+x1@NJg+o0VP?ZxN_f;s?gQ4qO*PK6-)=M<?S3yP>H(k=u)p(5nv5;(0v
zMU)iC4>I_aB7r{(;BZGoap?r^h*B9g_rT^SZ7z0%*hS!>`yzy5OKFHw3qCd#QgpmQ
e1+K5cqAJ07C{TtXXaWJ2Ua%Tx<rggCY~dfh7i>!a
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/try-012.js
@@ -0,0 +1,95 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: try-012.js
+ * ECMA Section:
+ * Description: The try statement
+ *
+ * This test has a try with no catch, and a finally. This is like try-003,
+ * but throws from a finally block, not the try block.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "try-012";
+var VERSION = "ECMA_2";
+var TITLE = "The try statement";
+var BUGNUMBER="336872";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// Tests start here.
+
+TrySomething( "x = \"hi\"", true );
+TrySomething( "throw \"boo\"", true );
+TrySomething( "throw 3", true );
+
+test();
+
+/**
+ * This function contains a try block with no catch block,
+ * but it does have a finally block. Try to evaluate expressions
+ * that do and do not throw exceptions.
+ *
+ * The productioni TryStatement Block Finally is evaluated as follows:
+ * 1. Evaluate Block
+ * 2. Evaluate Finally
+ * 3. If Result(2).type is normal return result 1 (in the test case, result 1 has
+ * the completion type throw)
+ * 4. return result 2 (does not get hit in this case)
+ *
+ */
+
+function TrySomething( expression, throwing ) {
+ innerFinally = "FAIL: DID NOT HIT INNER FINALLY BLOCK";
+ if (throwing) {
+ outerCatch = "FAILED: NO EXCEPTION CAUGHT";
+ } else {
+ outerCatch = "PASS";
+ }
+ outerFinally = "FAIL: DID NOT HIT OUTER FINALLY BLOCK";
+
+
+ // If the inner finally does not throw an exception, the result
+ // of the try block should be returned. (Type of inner return
+ // value should be throw if finally executes correctly
+
+ try {
+ try {
+ throw 0;
+ } finally {
+ innerFinally = "PASS";
+ eval( expression );
+ }
+ } catch ( e ) {
+ if (throwing) {
+ outerCatch = "PASS";
+ } else {
+ outerCatch = "FAIL: HIT OUTER CATCH BLOCK";
+ }
+ } finally {
+ outerFinally = "PASS";
+ }
+
+
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" ): evaluated inner finally block",
+ "PASS",
+ innerFinally );
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" ): evaluated outer catch block ",
+ "PASS",
+ outerCatch );
+ new TestCase(
+ SECTION,
+ "eval( " + expression +" ): evaluated outer finally block",
+ "PASS",
+ outerFinally );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..8017df083d2041906d2b81f07814e62a414f23ca
GIT binary patch
literal 749
zc${5O(TdtY6di^%gb;!R5fPC=#7awxEq!XAjGNs}QCm#dK1f-n=4yu>Gcp<1`qm%l
zr}ZcLBkk4g?kxKf?m0Q<+<PWYXCE`NxR{To)6x8^D4;aL96tPZUJTL`SP9U{kFAEP
z5~_SX5e77unbD$LTfT3{%y0u6wEEYxos`{Jlm%*ST6@f;d}O`iTJUcY&R{9I<_5Xm
zQ%>o@2-WNI7;L@oESYn?24lA{+{^XBYT3Ec8!kU%+y<~jHT>TtR!Radt<sOBTHZ9z
zcjfYUOstASJJ!H&9;z|i3)(<|cV<hqg&<pMu{Et3>}^i_%XcB+!PLJGd{lIi<@0oQ
zk=d93Mf+ivjPvx<EId=E1oxKf05f;e_<5R7lJF{-XDFaAy)CaQw%6F?5_kbRR};04
z_D9>R;qXl@hsun31<qg6IkBv|zvt%@{GJu6d~O)ra=Am!{$ZkGU>_3EipvT-gW;4#
zsMF@S$XjtCgJe7%UB6xA^CYpgp3yFIDD_<8`3@z7l0UV;325jM8r=;(?cEI?Z8|<-
zl;F44p!J|0prJ!N#Pr0rDH#yrx*ly%;v%|qom%A5u-_ytH*!v(+i5sGQja_|w`fS*
EfB!S;b^rhX
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/while-001.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: while-001
+ * ECMA Section:
+ * Description: while statement
+ *
+ * Verify that the while statement is not executed if the while expression is
+ * false
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "while-001";
+var VERSION = "ECMA_2";
+var TITLE = "while statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile();
+test();
+
+function DoWhile() {
+ result = "pass";
+
+ while (false) {
+ result = "fail";
+ break;
+ }
+
+ new TestCase(
+ SECTION,
+ "while statement: don't evaluate statement is expression is false",
+ "pass",
+ result );
+
+}
new file mode 100644
index 0000000000000000000000000000000000000000..017400d19a34c4650802e50c652db3705782623e
GIT binary patch
literal 1590
zc$}?L(P|qx6jd&R5W`@MHw?y@AdE4t*BeX-B_x~D*l}8yWLiA4*@aMw>``KE$1_1A
zI~(X%EX)2%|D*5ymr7$N@^<ssc^K&)-E;1_SL%;~HzB%uH9onxI2peeF;A6H_eWdg
zpgk&rYr*C4uUpCUTx99)xlmlPBvewQHx_T%ZK#;yb4{%eSdv)0(HCi~NmiC>gvooG
zQVaN<jk-ojOfUF+vT31xqL-W0RIs4?Ay_0y^O8xyCJ8^~(}YQ;GI_8mVwn+>H(b@D
znaDSq_@1sYdX~vKOWx^l&UNc~Z#{uvG3QcDEt_g}E)|cpN;u7KdG&0OPK`!Ci|_Zp
zuWiTBeIPy-Dd?>S`i7gG-~Kx=FPutotC|lA{Un=yEZCh#o11sg8D#nnj1t>G-GWyC
zeI^qAczai2G#&-7Li;9ua{utM$)9|xYNuI|{I-Zn>!=hC2hr$luybc3D^G4&p2N@o
z=x~uJdQ2PFOeBXipJj_ArfH_=j4e6kOO`Bj^_b=lCUPoLTFB9f@pwchlCzK7{81b@
zUNY%Mqv(7HImE=MxFQc&ux(}hnCHc$G@~5xTn$*xy_KQT<!~Ho+hm!EI9cjTy}qYv
z#?-p7twrxxzTvXHZeYS`rAYmy*V{YzA4#k@?MCC-?o)@_DNuSR^?kkOEao!G&a<0}
zHZPU2>U{e2?~fbZ(ceEptB^vyr`k#NgL96Li89t(Ev(yHJqRmz_!MuE#{62OJnlSo
z+Jk4_aBy+*VUHNsSJ8Mlv@i3k)1}yPfMD#m9l%?FK0CGAwg=k;!|rO+hG@0%;oQOK
z0FeGa_rdjC4`J9xzK$IqJOmzweh*%lxMO09A?S2=(E5XtIcb@bI)--^|JC3PgI6*1
zFw&>+a+O^*XbHm}dQ$*rfZ7PP2(DGCfKY`%y@W}PR7kbb0Mx}!*{?QG%`5~}%tBGs
zP#i#jwy62*l{mVHPSBh$#3?sh;65)m%O!-!{%(=sgDzKhK||E>P%|b7o1UR-l3)z(
io_pw?ngEsE*BI>-xkPU;pfb2{X=uKtX}AF{YJCHiTG?X&
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/while-002.js
@@ -0,0 +1,86 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: while-002
+ * ECMA Section:
+ * Description: while statement
+ *
+ * Verify that the while statement is not executed if the while expression is
+ * false
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "while-002";
+var VERSION = "ECMA_2";
+var TITLE = "while statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( new DoWhileObject(
+ "while expression is null",
+ null,
+ "result = \"fail: should not have evaluated statements in while block;break"
+ ) );
+
+DoWhile( new DoWhileObject(
+ "while expression is undefined",
+ void 0,
+ "result = \"fail: should not have evaluated statements in while block; break"
+ ));
+
+DoWhile( new DoWhileObject(
+ "while expression is 0",
+ 0,
+ "result = \"fail: should not have evaluated statements in while block; break;"
+ ));
+
+DoWhile( new DoWhileObject(
+ "while expression is eval(\"\")",
+ eval(""),
+ "result = \"fail: should not have evaluated statements in while block; break"
+ ));
+
+DoWhile( new DoWhileObject(
+ "while expression is NaN",
+ NaN,
+ "result = \"fail: should not have evaluated statements in while block; break"
+ ));
+
+test();
+
+function DoWhileObject( d, e, s ) {
+ this.description = d;
+ this.whileExpression = e;
+ this.statements = s;
+}
+
+function DoWhile( object ) {
+ result = "pass";
+
+ while ( expression = object.whileExpression ) {
+ eval( object.statements );
+ }
+
+ // verify that the while expression was evaluated
+
+ new TestCase(
+ SECTION,
+ "verify that while expression was evaluated (should be "+
+ object.whileExpression +")",
+ "pass",
+ (object.whileExpression == expression ||
+ ( isNaN(object.whileExpression) && isNaN(expression) )
+ ) ? "pass" : "fail" );
+
+ new TestCase(
+ SECTION,
+ object.description,
+ "pass",
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..04d634aeb35bf6fed71351c179bcb60ec352955b
GIT binary patch
literal 1458
zc${@o;cDYX5Z(;xB7`c8F~%5U7GZ>wy1`Au5$>AyV#m4j;ph%aq=it9wY847Cre?q
zjvKg_>dUmR(Kl#!B|9?LR6jI3-+uFbv$H!G`|kpD`(}D^eSI<gl}9X*Tt2?~$~^0i
z^JKx982x@PSeEfLIi7II1dRhJcyd?bUbze;m29O-TSFShCEoPerp(*{Pa-8znh=Fh
z@mNxNT8YoE*=n}mLia+2yF@#bp!LyT$MM;IMM(>(xMR}0p@P#{%r4nHra}?Zr1K?~
zidMMfSt(4E3=@(?iW$t)d)ByGCv#mpNTWw@m+Wbtera4Dv9}ZZptvihCYek2w?iGI
zY0PM{XMUB66^)<R*^cS2S4{AE$vhgSYMk1h?v1>&^BctJ{8R4L`gzG?R^HJ-F#72!
zwQ`~z%mu%fw?Q}^`)`8sReWv!VyCm;*jzf7X)e^<#`gspjE3R(z2DwwZ0{T@u475g
ziF;48%zXvlSm8LFj7*)@*b@;yPyrb*i0To`@-7rw%Xa-`7SDX@J2#_gpnU8?w-T~U
z4r#`Ya$i#F5uTCn4A1L7x8W|iTUF9R>iYOWO?2@{<dRDAANq!7ggwxBts03)H(RFb
zI3hDf77NPbmxPop5}s`9XL^`q!vrHqD$9Cf$?ehb`r_k>DV1|IXMfx8e{Y<h12H~-
zezsjH)@<_JM#45^`*gYs8fWa#)J+waP&Q_2f8!tIY`Jjw`v265+w2~ajZp9HEu#?=
zVLD0g>|*COoQ_82v-rz+(ZU88CdQ6y06qZphtaIpY-m^*UKR@%UK9%l-WnJk15*F6
z4z~Ibh98lma%g~w3<tx&I{-@qo(5VNx<@Gg{{E@JU5z&|T$;$o;GqI-YqW-8YN8w1
zVmrwmoaVq8Ac9cG#LY$>5UN^6*TGiPYFPDZ8&D4$m0GifnmU-Mp+g(hb%~)Q(Lqc9
zRkWas!9u#`Pt&Nl9XRP%+^U0+d3u~PnufA_XMuv+ClkX&USuMy4-9=xgAY*Y*{|&%
ebb_k(5k@3un`(gpRiOe`x~#6s6x@Oe>ii3!sHzqK
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/while-003.js
@@ -0,0 +1,87 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: while-003
+ * ECMA Section:
+ * Description: while statement
+ *
+ * The while expression evaluates to true, Statement returns abrupt completion.
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "while-003";
+var VERSION = "ECMA_2";
+var TITLE = "while statement";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile( new DoWhileObject(
+ "while expression is true",
+ true,
+ "result = \"pass\";" ));
+
+DoWhile( new DoWhileObject(
+ "while expression is 1",
+ 1,
+ "result = \"pass\";" ));
+
+DoWhile( new DoWhileObject(
+ "while expression is new Boolean(false)",
+ new Boolean(false),
+ "result = \"pass\";" ));
+
+DoWhile( new DoWhileObject(
+ "while expression is new Object()",
+ new Object(),
+ "result = \"pass\";" ));
+
+DoWhile( new DoWhileObject(
+ "while expression is \"hi\"",
+ "hi",
+ "result = \"pass\";" ));
+/*
+ DoWhile( new DoWhileObject(
+ "while expression has a continue in it",
+ "true",
+ "if ( i == void 0 ) i = 0; result=\"pass\"; if ( ++i == 1 ) {continue;} else {break;} result=\"fail\";"
+ ));
+*/
+test();
+
+function DoWhileObject( d, e, s ) {
+ this.description = d;
+ this.whileExpression = e;
+ this.statements = s;
+}
+
+function DoWhile( object ) {
+ result = "fail: statements in while block were not evaluated";
+
+ while ( expression = object.whileExpression ) {
+ eval( object.statements );
+ break;
+ }
+
+ // verify that the while expression was evaluated
+
+ new TestCase(
+ SECTION,
+ "verify that while expression was evaluated (should be "+
+ object.whileExpression +")",
+ "pass",
+ (object.whileExpression == expression ||
+ ( isNaN(object.whileExpression) && isNaN(expression) )
+ ) ? "pass" : "fail" );
+
+ new TestCase(
+ SECTION,
+ object.description,
+ "pass",
+ result );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..a8fac5004d4afd30ac3a4ebbd5803a9b282dd0cd
GIT binary patch
literal 2740
zc$}S;U2oeq6oy$s5ClOGJRvZQz%U5IFg(W%66a$<)^?2(w@HwAh3&LO+byFlI##QQ
z9xW&JFzjM?`;Ge(`v=>RsIS=0%@RN%4-e0I-j|fpI_sSG(8t%^qsz;q?oW=*Jm2x>
z-~XlVZeBP(6V&bb!trj}Unhc1rw;dOXJOLFVImDy(_zo2KD&h!(sDd1=IKfq0yfl2
z3sm1y;n0E0PT0_;g8GnES&VU^Uw3A%yL$vxZoHs$pNbpir*&%SQrd34!|u~r@tC@9
zI@Mb)AAZ@2G<IgUOgO`InY`lSmb!1C|1E=*Y2nq(8wPkSZqKXnB!f)=feD}4fZrSP
z2`j!EJ1$Gyh+DNdcNz6Et*$0E<Ya8RpabT*%ue<eTY}Lq$+UdTLAN(ciyOV6a3+4K
z%lw&0PvB#(-#zQR?xpAYxAh0!$lGih=0h`WLZ?&pjtaBaKJK6W*fD`(=K9;w-)64Q
zrv5RVGW<CT?O?}{Bh%*hfk<Uz!#d%i-s^3>f7ZWf7vg#IkdS0?HyJhaN$fCP-$|l-
zndn{;-8m$tKV~lH6PG+CLvAxdN8l?7LS!)WiQ`Q{EpY=6$#l$Tu1yAvu&-=5gVV9@
zIUjRA;B)2q^ZtlJRT~J$j-RbIj0`5z*h;H)^}2I)*=l#aVACP79h-REj|(rdG?rk@
zx9x5Z4DN)Mk$cA<6DpUOy`rNbNe@8h9bC@QoD70nKseOpBf0VOf(c8-r2c?2<AL%o
z!p}}uV#pQ=gXY8G+fwii6!E!i2MnRGfMb>MC0RVxva`MaU32gKf^~P)ok2#Lm(?)|
zwJi&Y4No>r2_5h|M&M$EH0QCHtU`~>yays%kN7G#1$F+6&5e}B_2FpQhzl85B+S@M
zYUdC2!Y3<nFe5a|TDXEDe3es`qm<VlQ~!bdv=*Vj75i$xSUx$KOQq)h$L<!W#NT3)
z@o30}V8g(Dz#IvFEBjfYT~D{Rb}axBe(<p{+Q*ki*Ui>r%>&!y5iDv1rvXi#z##ZO
zf08u@f`4HT4oJRUfvMTof!quD$euE4GtuW4{N`i7+iqw6tC?G6(<oMI<wil*4z<z?
zRnZCvqjzRSR}E}v8k)$#3*^f|33cV*5cQQj78t?v_dHgSim--UT!MKqj8?*DEqs>4
zXCr)eFd_(<rdEJFvxHGoQLJ1ZDV6Gzf>}_TI3LajjZ>LdjPg!Yh-36MSk2=C6kEgQ
zx`s6sp(2JU&IcQym!adeoNg!()GE>LIbM_G7`>DO9Vv2Ppl7<e4uiFI6#d9~E}7T2
zD(ZO+t>@yD%FBXTQk5W-+uQ;q9UZ{aKuSP$8dAw$L;&MwoI{_hPt<*!O9}*u<tQ;s
zdIb{nrDzkPMkGwvux?lwA*~k4`UYFEtcxXC(ZE8#)LR9!Asx1qMl0kUg}iUzX-Vp&
z?IyGxFTn)SlK^HZ>Os_6LM$&Mes~=5ZGAV3xEmtgg^0hcK&(RBPfLi^m54#q&LBqD
yBVcSqjK8Lg|Lb-X%zktkR@@Uy**smmAqO#B9pK(SxEcTa@PNL)@@CZIoADodDY@_f
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/Statements/while-004.js
@@ -0,0 +1,217 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: while-004
+ * ECMA Section:
+ * Description: while statement
+ *
+ * Author: christine@netscape.com
+ * Date: 11 August 1998
+ */
+var SECTION = "while-004";
+var VERSION = "ECMA_2";
+var TITLE = "while statement";
+var BUGNUMBER="316725";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+DoWhile_1();
+DoWhile_2();
+DoWhile_3();
+DoWhile_4();
+DoWhile_5();
+
+test();
+
+/**
+ * Break out of a while by calling return.
+ *
+ * Tests: 12.6.2 step 6.
+ */
+function dowhile() {
+ result = "pass";
+
+ while (true) {
+ return result;
+ result = "fail: hit code after return statement";
+ break;
+ }
+}
+
+function DoWhile_1() {
+ description = "return statement in a while block";
+
+ result = dowhile();
+
+ new TestCase(
+ SECTION,
+ "DoWhile_1" + description,
+ "pass",
+ result );
+}
+
+/**
+ * While with a labeled continue statement. Verify that statements
+ * after the continue statement are not evaluated.
+ *
+ * Tests: 12.6.2 step 8.
+ *
+ */
+function DoWhile_2() {
+ var description = "while with a labeled continue statement";
+ var result1 = "pass";
+ var result2 = "fail: did not execute code after loop, but inside label";
+ var i = 0;
+ var j = 0;
+
+theloop:
+ while( i++ < 10 ) {
+ j++;
+ continue theloop;
+ result1 = "failed: hit code after continue statement";
+ }
+ result2 = "pass";
+
+ new TestCase(
+ SECTION,
+ "DoWhile_2: " +description + " - code inside the loop, before the continue should be executed ("+j+")",
+ true,
+ j == 10 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_2: " +description +" - code after labeled continue should not be executed",
+ "pass",
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_2: " +description +" - code after loop but inside label should be executed",
+ "pass",
+ result2 );
+}
+
+/**
+ * While with a labeled break.
+ *
+ */
+function DoWhile_3() {
+ var description = "while with a labeled break statement";
+ var result1 = "pass";
+ var result2 = "pass";
+ var result3 = "fail: did not get to code after label";
+
+woohoo: {
+ while( true ) {
+ break woohoo;
+ result1 = "fail: got to code after a break";
+ }
+ result2 = "fail: got to code outside of loop but inside label";
+ }
+
+ result3 = "pass";
+
+ new TestCase(
+ SECTION,
+ "DoWhile_3: " +description +" - verify break out of loop",
+ "pass",
+ result1 );
+
+
+ new TestCase(
+ SECTION,
+ "DoWhile_3: " +description +" - verify break out of label",
+ "pass",
+ result2 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_3: " +description + " - verify correct exit from label",
+ "pass",
+ result3 );
+}
+
+
+/**
+ * Labled while with an unlabeled break
+ *
+ */
+function DoWhile_4() {
+ var description = "labeled while with an unlabeled break";
+ var result1 = "pass";
+ var result2 = "pass";
+ var result3 = "fail: did not evaluate statement after label";
+
+woohooboy: {
+ while( true ) {
+ break woohooboy;
+ result1 = "fail: got to code after the break";
+ }
+ result2 = "fail: broke out of while, but not out of label";
+ }
+ result3 = "pass";
+
+ new TestCase(
+ SECTION,
+ "DoWhile_4: " +description +" - verify break out of while loop",
+ "pass",
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_4: " +description + " - verify break out of label",
+ "pass",
+ result2 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_4: " +description +" - verify that statements after label are evaluated",
+ "pass",
+ result3 );
+}
+
+/**
+ * in this case, should behave the same way as
+ *
+ *
+ */
+function DoWhile_5() {
+ var description = "while with a labeled continue statement";
+ var result1 = "pass";
+ var result2 = "fail: did not execute code after loop, but inside label";
+ var i = 0;
+ var j = 0;
+
+theloop: {
+ j++;
+ while( i++ < 10 ) {
+ continue;
+ result1 = "failed: hit code after continue statement";
+ }
+ result2 = "pass";
+ }
+
+ new TestCase(
+ SECTION,
+ "DoWhile_5: " +description + " - continue should not execute statements above the loop",
+ true,
+ ( j == 1 ) );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_5: " +description +" - code after labeled continue should not be executed",
+ "pass",
+ result1 );
+
+ new TestCase(
+ SECTION,
+ "DoWhile_5: " +description +" - code after loop but inside label should be executed",
+ "pass",
+ result2 );
+}
+
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..814fa878d576c7c304c4df5935f627461a6ecf53
GIT binary patch
literal 1535
zc$~FTU2o!65FL%KEbGd(C_)G!ge-&*Bq<nhzS^keBP1nCXasDuYO+m@eV2G^Y;^5Z
ziK>0>Z|z&vU(jm|m~ORFUy6~LJ9FmDIdka^M^_WLzZ`dOZo1=lj?KK#317cql3u@d
zLdH#Z5^~3z4_=m>1%cyx)!_>C-eEjRYCXp@`D>CW^i9`IjwMmI1x?ahNs5!u4B0{y
z4x-4hZrEbBORle#jGh;aJ62LCb~!h9hF0!O?wB)|oiocdx#04>@~1hU)5p=X>*{@f
zv3w4h{pq-k@iB{B?|AG60pp@UFitFg$#NIZo)yjL`Sz=J;q!&*-ii?mCi;WQrn)0W
zd$Y8K*MyVyT;KY|5X{cpi&ii-`J9ExnsS0R+0RD7cFIbJGO@U`4DTn?@o;oGNpA5=
zDa3sxSY4pHFhlE!1qx?#_Oeu5=FP*Wj3_?Fnfw~?XhusVRV}U6>Z@Fp#y?%#zI6TB
zW;1;=U_n+Srz{AggY>J(N!y^}s@V(9i_KQsI6N|Emd%b&PW6I-?sQ_C?C;a*aC$vR
z)#|YvwPF9(`q-GOcZ2a{_`?X#@SQpt^rs>wwR>`^<1w-9O8lQ}tYm$q>&^OyAZl%j
zRyh=E$ngmp<nSonHrht?HPl+&@x*o0)f;s@O$VXL!$>=Qh^8uo{!RC>g@-GsaL|dT
z)R){3{qS|k*4xnHeQ7oNa4!0=g-v44@C1)&qir<iq}j^E)+5&udGq7_bUYX&7xM+J
z7bKD?$&yj6BLKo5axR@yFe4lAZ5-6$Z5&kLCo16-LA*;>iVCZb+<`JI*M~p9TL;id
zNeE?u%osGEFM<nK+lG`XK|Xq-@-5BtB6L7om&={hUIuKK3EB(z5kA1z@C0MHjlgF#
ze^-QqEjZIjWhr=q>w7qdlL(^I{Li}(p@b564`-s-Lnr|ps7gUrB#Odt0f8V9fn3t^
ziY&=gMp>3cJzGTh9c9s#?MMXT2UO9NLJE5*7!<^`geZLu^nir~RQL?&8ZiNl_R_h$
zST)&*2cjcUP?5_}sgg?8#)#(amgXN+M@XQRLj_50%ZMa$tk8cO&S+V>HN3L>7x_<a
I{|AkK1GgkvcmMzZ
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/match-001.js
@@ -0,0 +1,106 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/match-001.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * String.match( regexp )
+ *
+ * If regexp is not an object of type RegExp, it is replaced with result
+ * of the expression new RegExp(regexp). Let string denote the result of
+ * converting the this value to a string. If regexp.global is false,
+ * return the result obtained by invoking RegExp.prototype.exec (see
+ * section 15.7.5.3) on regexp with string as parameter.
+ *
+ * Otherwise, set the regexp.lastIndex property to 0 and invoke
+ * RegExp.prototype.exec repeatedly until there is no match. If there is a
+ * match with an empty string (in other words, if the value of
+ * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1.
+ * The value returned is an array with the properties 0 through n-1
+ * corresponding to the first element of the result of each matching
+ * invocation of RegExp.prototype.exec.
+ *
+ * Note that the match function is intentionally generic; it does not
+ * require that its this value be a string object. Therefore, it can be
+ * transferred to other kinds of objects for use as a method.
+ */
+
+var SECTION = "String/match-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.match( regexp )";
+
+startTest();
+
+// the regexp argument is not a RegExp object
+// this is not a string object
+
+// cases in which the regexp global property is false
+
+AddRegExpCases( 3, "3", "1234567890", 1, 2, ["3"] );
+
+// cases in which the regexp object global property is true
+
+AddGlobalRegExpCases( /34/g, "/34/g", "343443444", 3, ["34", "34", "34"] );
+AddGlobalRegExpCases( /\d{1}/g, "/d{1}/g", "123456abcde7890", 10,
+ ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] );
+
+AddGlobalRegExpCases( /\d{2}/g, "/d{2}/g", "123456abcde7890", 5,
+ ["12", "34", "56", "78", "90"] );
+
+AddGlobalRegExpCases( /\D{2}/g, "/d{2}/g", "123456abcde7890", 2,
+ ["ab", "cd"] );
+
+test();
+
+
+function AddRegExpCases(
+ regexp, str_regexp, string, length, index, matches_array ) {
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ length,
+ string.match(regexp).length );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").index",
+ index,
+ string.match(regexp).index );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").input",
+ string,
+ string.match(regexp).input );
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
+
+function AddGlobalRegExpCases(
+ regexp, str_regexp, string, length, matches_array ) {
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ length,
+ string.match(regexp).length );
+
+ for ( var matches = 0; matches < matches_array.length; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..b22ab7dfcb7344e68b6657bc1f5e930abe5756d9
GIT binary patch
literal 2132
zc$~#kZExa65MHfTmbJ1hgb<1lLRN&3A)G@w8bx<`1444733mb-T}xi-;Dz{VY_wjg
zM7{f6{agJB9ot}YxguRZl@G8p^UO0d&kU_@?_z*P=l$l@RkMF<Tg(-<cz*kfe4uwj
zV`4Mjd75+P`?lvAm$qQsbOwUk?lkdhE!#EubK<BDgemOt6`MV*=jYp|<0NJ&c?Nhk
zgNoZgWdV6op5FHsj#Iiexoti;?39filLNcw7GL^2UTAV|t~F9ycHCRc7`MksKySj&
z)D21|PTF$3@$a>^H=8d6vtG8}NOFcIpE8j&xxYT}OIRgtVtslIV2nc<m|`&Y=4_>I
zp9RvciMaxPfEi~DFd@9s_CTpX2XmeE=eY$^CXTJMg*y&VEzf$^&OAOdotVhab|<m)
zTM&$mLZ68RPxew;(X8pO4947^i_u`%@Al3I$^H1Ui+2=1yb^`8DSMjdW~LZFGXLHT
z7KD9uX)6wMr{a-@Cau+fc-_cA;(e4wILkIIYsh@jHhq?LOkZ?ei#@%c;F|P@$@376
z^a|oW(Y3TzHbOF;I`+&K=>^~?w#%$^oJ|f7sU18T`sl{G{qx5!WqtJOM!P)@&BmAV
zaq*5b?NHm*M{zs|ucEteHO`Ef5Rf`_a_)E!tNn%j$n1%Y>99Mz?BFul*}=E!pwk|9
z-}mrAspa_swyRy4zHeyZ=&7<1>4A?(c|<;cM(TB^KLETeK!f_mb{ZQaQ#?J1{;$TI
zd%_dXaA}c1S|qYoR?CL%!pW=4z<->*rp2Q)qd7`Z#odtZRjpPxKKW^1m|O&_49h{L
zVg&N&G_0+3+E>l{`e@kibdpOl)i*_n)C;n7wAaH3VRWdLQh5cZl_UHRJ$l%Q9((vB
zm63%Jd>0zDWL)AtZe>yUsh(t138!!hl^|Tt$tB|&4{<9aVVt5{g$%&ymWDF=G65m*
z%J{c{tWHq|-yvC+kh}#6xr8fB0k;z1jsQmxoF>?t(Xl^BdACf7otyIriX+P&|2_^V
z?m~*MNaFavvdQQJM*9fq3av^cjX~HVMiMDfcqxTimMTO^D_E&2l4@Y|6H)5qf>eNt
zG$f4hHmM+KJExu!;L0|npgMu=;2T8nK9T^4p&BB4sv00pmk8)l1JpK3<5LMqN&*bz
z%bt7-o1kg}s%`-Nif{t@l*(VgF%&E0>_v$eW+Ro)0g%S~CMSrZVimn9(41=FpxDQ_
z*jEMLA&L+3NJ2Cp^C222O66|_t=H1>QqWM&zp(sWauWOq^&&YV;P=b<zlrb<w`tiZ
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/match-002.js
@@ -0,0 +1,174 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/match-002.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * String.match( regexp )
+ *
+ * If regexp is not an object of type RegExp, it is replaced with result
+ * of the expression new RegExp(regexp). Let string denote the result of
+ * converting the this value to a string. If regexp.global is false,
+ * return the result obtained by invoking RegExp.prototype.exec (see
+ * section 15.7.5.3) on regexp with string as parameter.
+ *
+ * Otherwise, set the regexp.lastIndex property to 0 and invoke
+ * RegExp.prototype.exec repeatedly until there is no match. If there is a
+ * match with an empty string (in other words, if the value of
+ * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1.
+ * The value returned is an array with the properties 0 through n-1
+ * corresponding to the first element of the result of each matching
+ * invocation of RegExp.prototype.exec.
+ *
+ * Note that the match function is intentionally generic; it does not
+ * require that its this value be a string object. Therefore, it can be
+ * transferred to other kinds of objects for use as a method.
+ *
+ * This file tests cases in which regexp.global is false. Therefore,
+ * results should behave as regexp.exec with string passed as a parameter.
+ *
+ */
+
+var SECTION = "String/match-002.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.match( regexp )";
+
+startTest();
+
+// the regexp argument is not a RegExp object
+// this is not a string object
+
+AddRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/,
+ "/([\d]{5})([-\ ]?[\d]{4})?$/",
+ "Boston, Mass. 02134",
+ 14,
+ ["02134", "02134", undefined]);
+
+AddGlobalRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/g,
+ "/([\d]{5})([-\ ]?[\d]{4})?$/g",
+ "Boston, Mass. 02134",
+ ["02134"]);
+
+// set the value of lastIndex
+re = /([\d]{5})([-\ ]?[\d]{4})?$/;
+re.lastIndex = 0;
+
+s = "Boston, MA 02134";
+
+AddRegExpCases( re,
+ "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex =0",
+ s,
+ s.lastIndexOf("0"),
+ ["02134", "02134", undefined]);
+
+
+re.lastIndex = s.length;
+
+AddRegExpCases( re,
+ "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+ s.length,
+ s,
+ s.lastIndexOf("0"),
+ ["02134", "02134", undefined] );
+
+re.lastIndex = s.lastIndexOf("0");
+
+AddRegExpCases( re,
+ "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+ s.lastIndexOf("0"),
+ s,
+ s.lastIndexOf("0"),
+ ["02134", "02134", undefined]);
+
+re.lastIndex = s.lastIndexOf("0") + 1;
+
+AddRegExpCases( re,
+ "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+ s.lastIndexOf("0") +1,
+ s,
+ s.lastIndexOf("0"),
+ ["02134", "02134", undefined]);
+
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, string, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(string) == null || matches_array == null ) {
+ AddTestCase(
+ string + ".match(" + regexp +")",
+ matches_array,
+ string.match(regexp) );
+
+ return;
+ }
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ matches_array.length,
+ string.match(regexp).length );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").index",
+ index,
+ string.match(regexp).index );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").input",
+ string,
+ string.match(regexp).input );
+
+ var limit = matches_array.length > string.match(regexp).length ?
+ matches_array.length :
+ string.match(regexp).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
+
+function AddGlobalRegExpCases(
+ regexp, str_regexp, string, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(string) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + string +")",
+ matches_array,
+ regexp.exec(string) );
+
+ return;
+ }
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ matches_array.length,
+ string.match(regexp).length );
+
+ var limit = matches_array.length > string.match(regexp).length ?
+ matches_array.length :
+ string.match(regexp).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..ab76ff893c47b3c3d6d0b4c53ddd388befe27f9d
GIT binary patch
literal 1554
zc${sLZ)@X55XP5f5kd$dj4>euvlt^}$ET_}_ek&Z=WNGG9b(^Mso@S^2#U4wsg)(O
zT9<_0eXf43zUljpWLt9F>Wy}0fAc&uyW1U%t{pVF8h3`n&iF3yStJ7S{O+@SVh*z4
zF<`v^wBRgBf;ghxAoBQgk+5z8!MGPXf(Oy8$RG5)Ff78BBRmmIhiv|^EoT(V6kv03
ztbv6OT7|vY0b&-Vn+31jkCtIr?QrgGwPW0RJn$YucEP5h$H6m>>btp^A8)r)sJkAY
zF=4Mq8ZGCH2h&2ly-OA?D%~)i{@%<hw`ZqN#<*ZU^x;h71+#nce6fVY?r}7GF^rz}
z>}}N>m&<6HCbwp)j+t2U;?P<fkB<P%8FZ03?Onz^XZAKa-PnItohc6%g8sVjVY@J^
z3?B1>&E1Y!da+vrf$H1~bE{<HxZ}a-$|>H@KjafWB%I+yO|qAvhAf(iuPSFV_O#fa
zdt&;PCHG!>eP+k^ufq6Y<J9vKmS}54$^OzG9xsE^{i<HEkA8gJRyd=lv=n-Y7(_mM
z!geKJe|W6DqnufJ0>}#ZxGWK=z7huWK$K|1%Jfae9k@4ra(b%W_Q%fP!$@=bJs1AO
zq{e@gY>Llt!&p7~A2Nkkw*A`rEuq~w5%AvWutT#Z@yYuYW-WLuV)49SYfHMCg*Mve
z<cojz=TF}o=H%5EdUu|M?eC5AI=(9<!s8-sTW?saLnPn6$pR91rmdw&W1{wZ!_NH?
zIXs-W<9@%miivzwBUqCqyJ=yBF#1`pmCGuws5W`KT3EzgEt=%LBB4u+6zu>XcSrCe
z<OEV0l@Z2>>_a^%Nto;@+8)9O`)K{8jF~YjinL#FG9q${wAaWQs-^iCpada>u$t0m
zJ9NJJq6DKnzi#L6^R(LCss2B1BP5|4j7)@DimWOX3C=0SiJ`+v)!vpMt5#G=RdpMq
zzp(rUU*i_YNl=ayid#sfRsDj1P`xd!T%rCWs*q!(=3rCTQ{rMxKxaolnLzy_BUP4j
zP%f9R;XVulzuDQ?39WK@A3#072z-WgWVF%kfnL>poZ5ZL?Os@pkxnk^NJV-**F*Zh
DfEI-(
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/match-003.js
@@ -0,0 +1,132 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/match-003.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * String.match( regexp )
+ *
+ * If regexp is not an object of type RegExp, it is replaced with result
+ * of the expression new RegExp(regexp). Let string denote the result of
+ * converting the this value to a string. If regexp.global is false,
+ * return the result obtained by invoking RegExp.prototype.exec (see
+ * section 15.7.5.3) on regexp with string as parameter.
+ *
+ * Otherwise, set the regexp.lastIndex property to 0 and invoke
+ * RegExp.prototype.exec repeatedly until there is no match. If there is a
+ * match with an empty string (in other words, if the value of
+ * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1.
+ * The value returned is an array with the properties 0 through n-1
+ * corresponding to the first element of the result of each matching
+ * invocation of RegExp.prototype.exec.
+ *
+ * Note that the match function is intentionally generic; it does not
+ * require that its this value be a string object. Therefore, it can be
+ * transferred to other kinds of objects for use as a method.
+ */
+
+var SECTION = "String/match-003.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.match( regexp )";
+
+startTest();
+
+// the regexp argument is not a RegExp object
+// this is not a string object
+
+
+// [if regexp.global is true] set the regexp.lastIndex property to 0 and
+// invoke RegExp.prototype.exec repeatedly until there is no match. If
+// there is a match with an empty string (in other words, if the value of
+// regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1.
+// The value returned is an array with the properties 0 through n-1
+// corresponding to the first element of the result of each matching invocation
+// of RegExp.prototype.exec.
+
+
+// set the value of lastIndex
+re = /([\d]{5})([-\ ]?[\d]{4})?$/g;
+
+
+s = "Boston, MA 02134";
+
+AddGlobalRegExpCases( re,
+ "re = " + re,
+ s,
+ ["02134" ]);
+
+re.lastIndex = 0;
+
+AddGlobalRegExpCases(
+ re,
+ "re = " + re + "; re.lastIndex = 0 ",
+ s,
+ ["02134"]);
+
+
+re.lastIndex = s.length;
+
+AddGlobalRegExpCases(
+ re,
+ "re = " + re + "; re.lastIndex = " + s.length,
+ s,
+ ["02134"] );
+
+re.lastIndex = s.lastIndexOf("0");
+
+AddGlobalRegExpCases(
+ re,
+ "re = "+ re +"; re.lastIndex = " + s.lastIndexOf("0"),
+ s,
+ ["02134"]);
+
+re.lastIndex = s.lastIndexOf("0") + 1;
+
+AddGlobalRegExpCases(
+ re,
+ "re = " +re+ "; re.lastIndex = " + (s.lastIndexOf("0") +1),
+ s,
+ ["02134"]);
+
+test();
+
+function AddGlobalRegExpCases(
+ regexp, str_regexp, string, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( string.match(regexp) == null || matches_array == null ) {
+ AddTestCase(
+ string + ".match(" + str_regexp +")",
+ matches_array,
+ string.match(regexp) );
+
+ return;
+ }
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ matches_array.length,
+ string.match(regexp).length );
+
+ var limit = matches_array.length > string.match(regexp).length ?
+ matches_array.length :
+ string.match(regexp).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..e0a2cffb89dcfdcf507bf5b04eb6cfa38b978141
GIT binary patch
literal 1869
zc$~#j?QY^m6ulaaEX%T7WFdqQLRJ(ZAk<JwBa|k);VUU=U{^q*?Xp{HU;^G6jK)JZ
zk@l_nW1pvQ&`0RCO)#ZeY5&#!F*A40x%b>Nx6$d{3}AHKuXnrk{(F1IR>BrfKmH=0
z=Q_dR!DhVuxaQ3BY<Fce?3KlzqJVj83&t&HAh^AnNAco7Si+um*>bYaPd6>ciH=8@
zZic+5R5rTwGq5FIDC6G7agOgTZd((Fwb<0LxFuYkJq#hMycN{jEE%__QM$tJVqZb7
zj>~-Imx+SaC^)qEoQX(Zx#=#~8^LCWohc2+o&IhhlX1L8WrL}^W|=+{8y@wNyxOd$
zzRrd_dn!JoU!(XXLwNzGw(s4cluVs-YwrOPorhiWLeoV%{p{9Wi^(gO?;ytAdWPHR
zHv24S&qD(lOUv1*^3=hU+iUUs*nQ@|bd+N>81_58>p?U>AEgiEMD>E9P&u2k$8~CH
ziRprQW6N(q+n$tQRUNjPi$xp>;}9+VVev$LHXAZeG%b%&&S=iijl3BUa*AUwZ9%*=
zVnR7S%2RNj*dx8TAn(<1BxUx<ra|IRO%4gyjyrkoBA~_cW~e~n%(yW0HFt$8p4N<h
z`b5sP`*wfOdDYVf?dA|ydUB#WmM1!XEt1z8ch|kUZlm2-hMnPUo90KfTp=%L*;H`~
z@eS2>vs)im;4+kC?$U3YF~XjWd^QA>g7CNHa@G9cX?Zhf3R}a$)3y}d6BZY~JF4k-
zn0vbrVtrOBc{o8EuQb`ry|rVBlDBX_j`3tp=k`l`cJY1nhuU{FSs*iGjCO4pwr2#D
zu*PWEZ?~hje5KY5i54@8+&F912mpb+n$}|~i799FKHSvk>u}Se!*J7}6IF&^38=|b
z{Oq=mOFI5JC)?lr`Bzg-<|OD<6iI??ML}HVQiV7HT822JWyned(s2mBzh4$4LVrRE
z#9wS<06ynkzzKh!NgpJH(Bm&<kYPrk3Xs)Q>_{sRY{noU(UgokC3Bim6{=_oQ3{Ho
zNZK)hpQ&0TRdOUtKy#RqB*+m+iHz2wm`<-sVRaz%9Z-4+5(0^WQF^3lKB6V<6ebXr
z1dW;!NNNOBec0uHVQ;{QK*kq93n)aOw|eXbollwM=AgvEv8=~Z2$Xkjl2ec&Re|%A
zoY7{)FZO0v>|X`1K&HoOkU&oF@`3D|s>tZ+fu+S$UEW$6*!h{rUu7qyzhS-5&Jg(Z
JcK&ZB`~zHDvE~2(
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/match-004.js
@@ -0,0 +1,173 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/match-004.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * String.match( regexp )
+ *
+ * If regexp is not an object of type RegExp, it is replaced with result
+ * of the expression new RegExp(regexp). Let string denote the result of
+ * converting the this value to a string. If regexp.global is false,
+ * return the result obtained by invoking RegExp.prototype.exec (see
+ * section 15.7.5.3) on regexp with string as parameter.
+ *
+ * Otherwise, set the regexp.lastIndex property to 0 and invoke
+ * RegExp.prototype.exec repeatedly until there is no match. If there is a
+ * match with an empty string (in other words, if the value of
+ * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1.
+ * The value returned is an array with the properties 0 through n-1
+ * corresponding to the first element of the result of each matching
+ * invocation of RegExp.prototype.exec.
+ *
+ * Note that the match function is intentionally generic; it does not
+ * require that its this value be a string object. Therefore, it can be
+ * transferred to other kinds of objects for use as a method.
+ *
+ *
+ * The match function should be intentionally generic, and not require
+ * this to be a string.
+ *
+ */
+
+var SECTION = "String/match-004.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.match( regexp )";
+
+var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=345818";
+
+startTest();
+
+// set the value of lastIndex
+re = /0./;
+s = 10203040506070809000;
+
+Number.prototype.match = String.prototype.match;
+
+AddRegExpCases( re,
+ "re = " + re ,
+ s,
+ String(s),
+ 1,
+ ["02"]);
+
+
+re.lastIndex = 0;
+AddRegExpCases( re,
+ "re = " + re +" [lastIndex is " + re.lastIndex+"]",
+ s,
+ String(s),
+ 1,
+ ["02"]);
+/*
+
+re.lastIndex = s.length;
+
+AddRegExpCases( re,
+"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+s.length,
+s,
+s.lastIndexOf("0"),
+null );
+
+re.lastIndex = s.lastIndexOf("0");
+
+AddRegExpCases( re,
+"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+s.lastIndexOf("0"),
+s,
+s.lastIndexOf("0"),
+["02134"]);
+
+re.lastIndex = s.lastIndexOf("0") + 1;
+
+AddRegExpCases( re,
+"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " +
+s.lastIndexOf("0") +1,
+s,
+0,
+null);
+*/
+test();
+
+function AddRegExpCases(
+ regexp, str_regexp, string, str_string, index, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(string) == null || matches_array == null ) {
+ AddTestCase(
+ string + ".match(" + regexp +")",
+ matches_array,
+ string.match(regexp) );
+
+ return;
+ }
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ matches_array.length,
+ string.match(regexp).length );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").index",
+ index,
+ string.match(regexp).index );
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").input",
+ str_string,
+ string.match(regexp).input );
+
+ var limit = matches_array.length > string.match(regexp).length ?
+ matches_array.length :
+ string.match(regexp).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
+
+function AddGlobalRegExpCases(
+ regexp, str_regexp, string, matches_array ) {
+
+ // prevent a runtime error
+
+ if ( regexp.exec(string) == null || matches_array == null ) {
+ AddTestCase(
+ regexp + ".exec(" + string +")",
+ matches_array,
+ regexp.exec(string) );
+
+ return;
+ }
+
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +").length",
+ matches_array.length,
+ string.match(regexp).length );
+
+ var limit = matches_array.length > string.match(regexp).length ?
+ matches_array.length :
+ string.match(regexp).length;
+
+ for ( var matches = 0; matches < limit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).match(" + str_regexp +")[" + matches +"]",
+ matches_array[matches],
+ string.match(regexp)[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..72cfb7255a75fc5162d8380d66de5ac7d5fcdf0f
GIT binary patch
literal 1541
zc$}3|?P}vj6rElMA%qY{1S5<wA_T9UxQZLXQraZccAQ;@#0{1jmi4CYM4CEk^~Gr1
zT|Y!0pifcyhMkd|$eT@nR01(G=iGD8xufA^dg-G1o7v#{dN8{S1Df!VufP9WIqpn~
z&95P4<4+l*c^;;Ta}{#RNaS)BCd=yF9)<~F>*}EAa>7IZn#T9r_0189qH4P<$^s!&
zwQ5(ORG_f{_HGFa$$do6sUHzWc*@$(j|9IzO5<$BY4E(MwwSJ>$R6Z5WdatZuAgR9
z8%C-Bd;4OQ__BOkX_IogiYW{It(X@ni%E1Ncrg`}{8)&F%S5{L2wPHKC9!|X0ui7p
zZVebC+ar23^dwi<vK|c$(_sDRWSFKAB}r9m2`5hj(p{g08E;JK$BMB(O2urY5ZRje
z-1TOY=^MAY>O&=f13fP;)QAc9A82moG%E*P&$B4x3nHx>g0v8b9?@jUAG89(9b5T>
zFw^cj#lBM?1c66$J|a2QqA(7*DeH<=Ltw6CNifGf8@O>hp1G4Brw~Hk5%87d(JdC7
z7=>_5>wcODsg*B$0fjq!dI~W_S}|9{9gjSrqj?kWY77}ZIKbVxJ|0~U7DxEit6JA7
zZL3_E(`Quvy>NC+{g^C{4$B|<u;}!4zyFQ%TaK)RezZ$srz-=N0*c+8_qxuO8T<6q
zE=-7|gmIbPv0r9*Wg{nJDNp%2qnoMOj4tV?tY^=A#iZ^;6K^&iSNHUf>eLn7X{yS}
z*)AXi=ug$GnK~HS3CzmHE?kt0Gq~4P^fMswZT3~@fd_B*S_ZV?2ly8Dz=qe*m*8sw
z_R$m&+`fcg0cs%B)>K8+Ky<AGQm}=^N^7=Eai%Gnrl~s}K!1TM3hHkajLH{k2w(?k
z@L~Tee5|Mn0z(n?4*E_K&%Y#IDoE8UqFysEMHuS{-#i1JZF@DdA&9t%HV@uMSaNpJ
z(8ktI0J7n`r-q+3Jx3UhOr#=gJ}DwBQyaRasEx<m7>d}PRzu&!wzNhWeGQ6i@ZseK
kE!2Qtsu5^d=v$j1-28XRJM@1d@*?8HXL4UizJD?5zt2c?T>t<8
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/split-001.js
@@ -0,0 +1,112 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/split-001.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * Since regular expressions have been part of JavaScript since 1.2, there
+ * are already tests for regular expressions in the js1_2/regexp folder.
+ *
+ * These new tests try to supplement the existing tests, and verify that
+ * our implementation of RegExp conforms to the ECMA specification, but
+ * does not try to be as exhaustive as in previous tests.
+ *
+ * The [,limit] argument to String.split is new, and not covered in any
+ * existing tests.
+ *
+ * String.split cases are covered in ecma/String/15.5.4.8-*.js.
+ * String.split where separator is a RegExp are in
+ * js1_2/regexp/string_split.js
+ *
+ */
+
+var SECTION = "ecma_2/String/split-001.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.split( regexp, [,limit] )";
+
+startTest();
+
+// the separator is not supplied
+// separator is undefined
+// separator is an empty string
+
+AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] );
+AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] );
+
+// separartor is a regexp
+// separator regexp value global setting is set
+// string is an empty string
+// if separator is an empty string, split each by character
+
+// this is not a String object
+
+// limit is not a number
+// limit is undefined
+// limit is larger than 2^32-1
+// limit is a negative number
+
+test();
+
+function AddSplitCases( string, separator, str_sep, split_array ) {
+
+ // verify that the result of split is an object of type Array
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +").constructor == Array",
+ true,
+ string.split(separator).constructor == Array );
+
+ // check the number of items in the array
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +").length",
+ split_array.length,
+ string.split(separator).length );
+
+ // check the value of each array item
+ var limit = (split_array.length > string.split(separator).length )
+ ? split_array.length : string.split(separator).length;
+
+ for ( var matches = 0; matches < split_array.length; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +")[" + matches +"]",
+ split_array[matches],
+ string.split( separator )[matches] );
+ }
+}
+
+function AddLimitedSplitCases(
+ string, separator, str_sep, limit, str_limit, split_array ) {
+
+ // verify that the result of split is an object of type Array
+
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + str_limit +
+ " ).constructor == Array",
+ true,
+ string.split(separator, limit).constructor == Array );
+
+ // check the length of the array
+
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + str_limit + " ).length",
+ length,
+ string.split(separator).length );
+
+ // check the value of each array item
+
+ for ( var matches = 0; matches < split_array.length; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + str_limit + " )[" + matches +"]",
+ split_array[matches],
+ string.split( separator )[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..7c296f73a9b80d3079e24d16f5ac04dc6cff21e8
GIT binary patch
literal 3620
zc$}qG|7#=16@MLuWjh^)MJ!?wLTpu6_<V}vs>U_0&ynRXIUTm{kaW%^&YiN7#@1d|
zT6MK{>~NG2LMWxQp)IA9Qc5W$B&D>a^w<90zotL+x01Zsm3JlInO>;{-Z$^P`Ml5P
z&70j?y>YJv$FDcH4-dDSkKMi;g>HEH-OpKLu^uf>Tp8?Li~~8Dxc;b=nyt_Y<q%Ws
znmclW%QUib;D$1AyvEs325v76<aZp;OP6H@;r0&Yusd60dAhw72JYxI^|Man%=3y^
zt&jec-QqTePe+PMn!K7i+fHyQ!!$ozKS{W=n&<c4Egd<5>vTQ2D|?<3ASr*eaNXwz
zg{BP8f>d~}A>T_YZtnQQ@mVPQv7YPoubNWxeNQ^0nQqPRO9M7S$N&S#q}B7svb29T
z>M3qBH0^yq7&_hqTn;4`n3S(}C9Y_%b+xzV_b)Bnl&G+FozQs@U``NTmZmJP)(wQP
zACCK&n-W{v@$m>0m@{*lg@^M~VBhaPmA#oG$-gmhJ(<)kB1-6v&QcF=^#XSs77v`R
z^gP*50{L1Xop+Pvy6TvJHtN6V;MZq|>iQuZx7y8m<MmcL=s(f_PHuBgj!we?+0IPl
zI6iAOKnlKg?gYdoO7Rc_vNiVH@C`Q{9JoU_BrWnidgqQgQQi(VZfMQs@kunm9IpXV
zAx#nIeQWxxFi(N#hfX*!0@;+4GcP1#;*s~Yo--z!<dqmXN+T2c^*b7xB(P%KP87^w
z8{~;Ql6^BOifFxoHum2mZF>7Qi*mBt{eD|c!X0NK#d73YG}`_{cNBiRV#rayju;n2
zk}U%Z<A}?NuKLE~8%P}9>4XD!qB-3O+YSQf(!6EgT8^7WZyoEN?~hr#-agpN_WTjj
zJL_Q!Y1z(<13&b`%dw=-o{`7ADb;;u6VL5QakSTL)$ccWZ{P&mp=j;xv~funZQ=v{
z0+<`I8jz*TBy@sMDbTvUuQi;;s_YG&PUY2@;H#0OS5{Uk%TFhIh<R+N+CaW(MyD7K
zWFU(V?zigg`q5se-q^1<>g_j;(2w`G<HvGBcG@F5kf-uuT(*zP(HT6pZ|Ud0+b0*)
z^VkWh4*1^A;dZA&Z{Im?H~03^x%ydgcagK4vEQ!g+DGFL2mk@McsIv5$r~T>U&Y1;
z{I9Vw=ARNBeog@Y=NRQW|5IWuC)OVm>yyO#L1O7w7VIXzA12oClw}Yb-q8rAW)2t>
z&Kr!uJLe4*TA?-+Orn+k!$0|S<9tVh=<i>zVbG{)Hw6EuEU3Oz7Q9T>n-SLjO<9|t
z&7ob~lt<Te28(w~G@&>(s?|AZt2Y7gU#Rf28+oj~Yz3jIqlRB9J0IC|3g%q#j`^(W
zb1waPm!Vw0Ca?sstWhnGW4TB`qa_P1BUfhB$QzniA@Ci-NX9H8_k2Uc6kIImP-7JG
zxX|Ijnnof1@sA<To1pQh3>FB3BFV93oaxdAeM_ybyy{uWu^fi1L>pZN3rg#7U|N=F
z5QSVzkSR=&J+S!uC0GEf1VykEeO=Smukkm^LR0*Wb)}#)qX21Zus+owG^GKTSZjZ#
z){K%6*8hJsPa-wVxeAFQRpEuI`Xwz^#Tm_%%?(OwcpH?mJ}N6IWsY9Ru`CwO=;}5@
zKgTk-!V5egkfm8D!LB8m1odv+IDW6C<7Wvg%GIHbXr&x85N(4&hQ#{Hi9Q9cDey%~
zGDS#00Wt-k0>ccn0G=V59nFl5)wMswthSQuY3_f4f{nyyiKqC=GFNoi&ud^qW`@xw
ztSm%`FM^5Rt|pZCN7aR|SmG~4SI8!8-2IW5B8mtR%qf&5c8H?>h{4JcJ}dZqTg4th
z*%DtR9DVmtR_6OSRb?=vvJ5DJdy#%LwqiPF86M$(o^XmNd>k?03@XGD85D0Kz1m3S
za~uzz-tjBo5>$ZCVGEUQVzxPxeG@C(5RaCfF)4lkaJF=fSC=%p&+!$iM$0xbhN(vD
z8<a$aY&=9ue2vf?D_{ec5ZV3>B1dh?;`?K_pgQ$W)u=AcolWQ(gC&yCnO==l4PFhd
zGSubZid~mM7o{x$FKlhl)wLrE82>RtSNi5#U3(iUmiRZ1hq8(^)Tl<onWb;34nP$)
zkc_xiF}jQ#s!=^lY-0MR>d%LQM7y|>^dZhWSDV#2N7tvYRfxGL;HbLl9VH^Zl$1Q7
zqzy*9tPw+~j{SqE%|eF)V&S|UAcrTY2Sh?-bM5)>WtLvxFRL!+iQ1U5PJQ@={yol}
t0AYzNDI_UTLHbj8qB8$%l4L{V|1F3czc|@BUY6J*<lf)RoAX5h#Fu%Y#Lxf$
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/split-002.js
@@ -0,0 +1,270 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/split-002.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * Since regular expressions have been part of JavaScript since 1.2, there
+ * are already tests for regular expressions in the js1_2/regexp folder.
+ *
+ * These new tests try to supplement the existing tests, and verify that
+ * our implementation of RegExp conforms to the ECMA specification, but
+ * does not try to be as exhaustive as in previous tests.
+ *
+ * The [,limit] argument to String.split is new, and not covered in any
+ * existing tests.
+ *
+ * String.split cases are covered in ecma/String/15.5.4.8-*.js.
+ * String.split where separator is a RegExp are in
+ * js1_2/regexp/string_split.js
+ *
+ */
+
+var SECTION = "ecma_2/String/split-002.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.split( regexp, [,limit] )";
+
+startTest();
+
+// the separator is not supplied
+// separator is undefined
+// separator is an empty string
+
+// AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] );
+// AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] );
+
+// separator is an empty regexp
+// separator is not supplied
+
+CompareSplit( "hello", "ll" );
+
+CompareSplit( "hello", "l" );
+CompareSplit( "hello", "x" );
+CompareSplit( "hello", "h" );
+CompareSplit( "hello", "o" );
+CompareSplit( "hello", "hello" );
+CompareSplit( "hello", undefined );
+
+CompareSplit( "hello", "");
+CompareSplit( "hello", "hellothere" );
+
+CompareSplit( new String("hello" ) );
+
+
+Number.prototype.split = String.prototype.split;
+
+CompareSplit( new Number(100111122133144155), 1 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, 1 );
+
+CompareSplitWithLimit(new Number(100111122133144155), 1, 2 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, 0 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, 100 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, void 0 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, Math.pow(2,32)-1 );
+CompareSplitWithLimit(new Number(100111122133144155), 1, "boo" );
+CompareSplitWithLimit(new Number(100111122133144155), 1, -(Math.pow(2,32)-1) );
+CompareSplitWithLimit( "hello", "l", NaN );
+CompareSplitWithLimit( "hello", "l", 0 );
+CompareSplitWithLimit( "hello", "l", 1 );
+CompareSplitWithLimit( "hello", "l", 2 );
+CompareSplitWithLimit( "hello", "l", 3 );
+CompareSplitWithLimit( "hello", "l", 4 );
+
+
+/*
+ CompareSplitWithLimit( "hello", "ll", 0 );
+ CompareSplitWithLimit( "hello", "ll", 1 );
+ CompareSplitWithLimit( "hello", "ll", 2 );
+ CompareSplit( "", " " );
+ CompareSplit( "" );
+*/
+
+// separartor is a regexp
+// separator regexp value global setting is set
+// string is an empty string
+// if separator is an empty string, split each by character
+
+// this is not a String object
+
+// limit is not a number
+// limit is undefined
+// limit is larger than 2^32-1
+// limit is a negative number
+
+test();
+
+function CompareSplit( string, separator ) {
+ split_1 = string.split( separator );
+ split_2 = string_split( string, separator );
+
+ AddTestCase(
+ "( " + string +".split(" + separator + ") ).length" ,
+ split_2.length,
+ split_1.length );
+
+ var limit = split_1.length > split_2.length ?
+ split_1.length : split_2.length;
+
+ for ( var split_item = 0; split_item < limit; split_item++ ) {
+ AddTestCase(
+ string + ".split(" + separator + ")["+split_item+"]",
+ split_2[split_item],
+ split_1[split_item] );
+ }
+}
+
+function CompareSplitWithLimit( string, separator, splitlimit ) {
+ split_1 = string.split( separator, splitlimit );
+ split_2 = string_split( string, separator, splitlimit );
+
+ AddTestCase(
+ "( " + string +".split(" + separator + ", " + splitlimit+") ).length" ,
+ split_2.length,
+ split_1.length );
+
+ var limit = split_1.length > split_2.length ?
+ split_1.length : split_2.length;
+
+ for ( var split_item = 0; split_item < limit; split_item++ ) {
+ AddTestCase(
+ string + ".split(" + separator + ", " + splitlimit+")["+split_item+"]",
+ split_2[split_item],
+ split_1[split_item] );
+ }
+}
+
+function string_split ( __this, separator, limit ) {
+ var S = String(__this ); // 1
+
+ var A = new Array(); // 2
+
+ if ( limit == undefined ) { // 3
+ lim = Math.pow(2, 31 ) -1;
+ } else {
+ lim = ToUint32( limit );
+ }
+
+ var s = S.length; // 4
+ var p = 0; // 5
+
+ if ( separator == undefined ) { // 8
+ A[0] = S;
+ return A;
+ }
+
+ if ( separator.constructor == RegExp ) // 6
+ R = separator;
+ else
+ R = separator.toString();
+
+ if (lim == 0) return A; // 7
+
+ if ( separator == undefined ) { // 8
+ A[0] = S;
+ return A;
+ }
+
+ if (s == 0) { // 9
+ z = SplitMatch(R, S, 0);
+ if (z != false) return A;
+ A[0] = S;
+ return A;
+ }
+
+ var q = p; // 10
+loop:
+ while (true ) {
+
+ if ( q == s ) break; // 11
+
+ z = SplitMatch(R, S, q); // 12
+
+//print("Returned ", z);
+
+ if (z != false) { // 13
+ e = z.endIndex; // 14
+ cap = z.captures; // 14
+ if (e != p) { // 15
+//print("S = ", S, ", p = ", p, ", q = ", q);
+ T = S.slice(p, q); // 16
+//print("T = ", T);
+ A[A.length] = T; // 17
+ if (A.length == lim) return A; // 18
+ p = e; // 19
+ i = 0; // 20
+ while (true) { // 25
+ if (i == cap.length) { // 21
+ q = p; // 10
+ continue loop;
+ }
+ i = i + 1; // 22
+ A[A.length] = cap[i] // 23
+ if (A.length == lim) return A; // 24
+ }
+ }
+ }
+
+ q = q + 1; // 26
+ }
+
+ T = S.slice(p, q);
+ A[A.length] = T;
+ return A;
+}
+
+function SplitMatch(R, S, q)
+{
+ if (R.constructor == RegExp) { // 1
+ var reResult = R.match(S, q); // 8
+ if (reResult == undefined)
+ return false;
+ else {
+ a = new Array(reResult.length - 1);
+ for (var i = 1; i < reResult.length; i++)
+ a[a.length] = reResult[i];
+ return { endIndex : reResult.index + reResult[0].length, captures : cap };
+ }
+ }
+ else {
+ var r = R.length; // 2
+ s = S.length; // 3
+ if ((q + r) > s) return false; // 4
+ for (var i = 0; i < r; i++) {
+//print("S.charAt(", q + i, ") = ", S.charAt(q + i), ", R.charAt(", i, ") = ", R.charAt(i));
+ if (S.charAt(q + i) != R.charAt(i)) // 5
+ return false;
+ }
+ cap = new Array(); // 6
+ return { endIndex : q + r, captures : cap }; // 7
+ }
+}
+
+function ToUint32( n ) {
+ n = Number( n );
+ var sign = ( n < 0 ) ? -1 : 1;
+
+ if ( Math.abs( n ) == 0
+ || Math.abs( n ) == Number.POSITIVE_INFINITY
+ || n != n) {
+ return 0;
+ }
+ n = sign * Math.floor( Math.abs(n) )
+
+ n = n % Math.pow(2,32);
+
+ if ( n < 0 ){
+ n += Math.pow(2,32);
+ }
+
+ return ( n );
+}
new file mode 100644
index 0000000000000000000000000000000000000000..995ad15b2298a1fc93378ecfaeb88096f050e73c
GIT binary patch
literal 2113
zc$|Gx|8Ck=7`?r+EX%sG5JFajB4kAfLBfc|P!+XFTYjY>N?3(yRE=iLv2Vbeu`S!Q
z$)oh|KFpqA@3A-7zH4J_oUB-a>+hWJ`_4Hwz0vqmL$mjj?)7zda%-8?39az)^}qZ{
z>&gnLuiIMaTh3zm;Q2HNEZ3=zBGSD@{j{j`EJybr)53mVx9#+{mL9cG59ta<G}*~A
zuIcJ7JF3$4eLXYj07jdjAYH3&l#SOb>RU!iEsyEf^e!<lp-g>7%Z=_^`khS&)Ub6Q
zG`LPRUvqtNK3?0l+ILspI;3V^rqT@p>H`3sn&Em>?AfmIXYG9L7;Iu@xN`3LE8YG8
zw<`*gg2TQGmKdaGGTH;$HXP-nXTmW>6VpA{wW;o8^7^=&d<TSC3x^Gv>i&X;X>iR%
z^Hxfvd@s@5bInJh8NTI(Gi^E<jo)kOE79fe@ev84w*lMYlG?Ug@0#Y7wE|_P=Gj)*
z*8>_LX{Cq8k_N?qdU2L=z|gtQo-DDcvj~@>&H5ymHwT&+5lRmIs>F|r#6SG8eT-ea
z<iF@XrreTpbw!4yQyN6eib|suwbsi}O*L>$g#^(CF?yXOZP=fVei_S#>%hvj0iw9G
zGknV}E&N8h8BR1ng)gpUiqp~bYFJ!5CcU>DYH~+M__PIkGOfzlnG((AmBx$=``6uh
zyU=LG&YI6tnbeq23_{%xnS~BDR{Fes9RJ6TBPTzp>d&n|f@xf9dA=LE;iE@4J{6xX
z=!4f(X3faot<vBcGa-a&v*~0wOdr@^g_jkc6I6jexfo!CF#2BT$W?;(q!aX8d>Ei<
ze7Hcr3q1ae5qzsH0r5q=4?Sffi|7E=5C@mSumiwKoQNt!;!z!mQB|mmn`!}VJ|r3?
zG;_c|ZwZf4ok428=N%C_Hj;sz94Nfo*_Ve4yYNW@x6V^RSwcA>z|vS~EvewkEb~WM
zMCLYF-naS$ik%-M>T`XOcNm_i--ToM(QZaKeL?{LMIjN#D1(%e%^>fflG3(Gw9^`7
zk?SzQ0zz$3kP0#eN(CdHD?ulc)M`<Xup~*cR48{a`i2E)XkPFfiZ65s9W5-QPt6zH
zsmO~M@9`K*ukcGo96Tl7h`3NpiAA}33GZsD#`SVQ?zS#h%RnSs<J=e%#yLb+DpATN
zW(z-U7w#;*!vwwA#|2FGw-Yg8u8CO6+9n-lTd2z7#&#(-{&#Hr^Yi1|xP(5W0f-z-
vFKr_DA4RO?*VJO%0%457W9LU<Y?#l+fjgTp9-=Vpoz+j)PjaEelQH=ZzHO%B
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/String/split-003.js
@@ -0,0 +1,123 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: String/split-003.js
+ * ECMA Section: 15.6.4.9
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+
+/*
+ * Since regular expressions have been part of JavaScript since 1.2, there
+ * are already tests for regular expressions in the js1_2/regexp folder.
+ *
+ * These new tests try to supplement the existing tests, and verify that
+ * our implementation of RegExp conforms to the ECMA specification, but
+ * does not try to be as exhaustive as in previous tests.
+ *
+ * The [,limit] argument to String.split is new, and not covered in any
+ * existing tests.
+ *
+ * String.split cases are covered in ecma/String/15.5.4.8-*.js.
+ * String.split where separator is a RegExp are in
+ * js1_2/regexp/string_split.js
+ *
+ */
+
+var SECTION = "ecma_2/String/split-003.js";
+var VERSION = "ECMA_2";
+var TITLE = "String.prototype.split( regexp, [,limit] )";
+
+startTest();
+
+// separator is a regexp
+// separator regexp value global setting is set
+// string is an empty string
+// if separator is an empty string, split each by character
+
+
+AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] );
+
+AddSplitCases( "hello", /l/, "/l/", ["he","","o"] );
+AddLimitedSplitCases( "hello", /l/, "/l/", 0, [] );
+AddLimitedSplitCases( "hello", /l/, "/l/", 1, ["he"] );
+AddLimitedSplitCases( "hello", /l/, "/l/", 2, ["he",""] );
+AddLimitedSplitCases( "hello", /l/, "/l/", 3, ["he","","o"] );
+AddLimitedSplitCases( "hello", /l/, "/l/", 4, ["he","","o"] );
+AddLimitedSplitCases( "hello", /l/, "/l/", void 0, ["he","","o"] );
+AddLimitedSplitCases( "hello", /l/, "/l/", "hi", [] );
+AddLimitedSplitCases( "hello", /l/, "/l/", undefined, ["he","","o"] );
+
+AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 0, [] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 1, ["h"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 2, ["h","e"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 3, ["h","e","l"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 4, ["h","e","l","l"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", void 0, ["h","e","l","l","o"] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", "hi", [] );
+AddLimitedSplitCases( "hello", new RegExp, "new RegExp", undefined, ["h","e","l","l","o"] );
+
+test();
+
+function AddSplitCases( string, separator, str_sep, split_array ) {
+ // verify that the result of split is an object of type Array
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +").constructor == Array",
+ true,
+ string.split(separator).constructor == Array );
+
+ // check the number of items in the array
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +").length",
+ split_array.length,
+ string.split(separator).length );
+
+ // check the value of each array item
+ var limit = (split_array.length > string.split(separator).length )
+ ? split_array.length : string.split(separator).length;
+
+ for ( var matches = 0; matches < split_array.length; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +")[" + matches +"]",
+ split_array[matches],
+ string.split( separator )[matches] );
+ }
+}
+
+function AddLimitedSplitCases(
+ string, separator, str_sep, limit, split_array ) {
+
+ // verify that the result of split is an object of type Array
+
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + limit +
+ " ).constructor == Array",
+ true,
+ string.split(separator, limit).constructor == Array );
+
+ // check the length of the array
+
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + limit + " ).length",
+ split_array.length,
+ string.split(separator, limit).length );
+
+ // check the value of each array item
+
+ var slimit = (split_array.length > string.split(separator).length )
+ ? split_array.length : string.split(separator, limit).length;
+
+ for ( var matches = 0; matches < slimit; matches++ ) {
+ AddTestCase(
+ "( " + string + " ).split(" + str_sep +", " + limit + " )[" + matches +"]",
+ split_array[matches],
+ string.split( separator, limit )[matches] );
+ }
+}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..7bc3ea75526f5aad57bb952111b5c873a261d5d6
GIT binary patch
literal 592
zc${5O&1%~~5MCA`gjkFb!2}bE2_ZP(q-jruo)lFCmDmYdk&7u}Eltf9MJq<rrhcD3
zO5dn2&{bTzCa0PCerCVfn{4%2vh{5qFPCxtMc2@hrrpOsd^*owhOZhh{n;V(y*BMa
zk|JF#;c0USpFb+pYSX|cs2YV<V%pOi-PXF@x;0mKngCTJ2`%p2XRqA`&mB9w2v2s$
zNurv@;nNj7yJ;TVvTX;Q1BI+mcl6;fw9^#|w?H!s020(Tgse;lYgy#k>Q=hXF#OE_
zp-|*7g!T}k4h<RFbufBNbD7<*MlwwbTf-tN?ox5T`34m&_J+5WX?w!&mA&io`ug1@
zuImDNN>mTWEj-WmviU_+mM@FTGU`bo4Wcob{ddi5)}&E=|A00m(r$5Rz4~tr$ht(D
zEaUS1y2#Vi-SPYAn6oelMc{G9IQupBnBbuw2LGBMINdiQI1(df)gqd3#{Cn{*~p)I
YEV86GW_GlEH1UHs1I?K?vGa_xzieK)>;M1&
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/constructor-001.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/constructor-001.js
+ * ECMA Section: 15.7.3.3
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/constructor-001";
+var VERSION = "ECMA_2";
+var TITLE = "new RegExp()";
+
+startTest();
+
+/*
+ * for each test case, verify:
+ * - verify that [[Class]] property is RegExp
+ * - prototype property should be set to RegExp.prototype
+ * - source is set to the empty string
+ * - global property is set to false
+ * - ignoreCase property is set to false
+ * - multiline property is set to false
+ * - lastIndex property is set to 0
+ */
+
+RegExp.prototype.getClassProperty = Object.prototype.toString;
+var re = new RegExp();
+
+AddTestCase(
+ "new RegExp().__proto__",
+ RegExp.prototype,
+ re.__proto__
+ );
+
+test()
new file mode 100644
index 0000000000000000000000000000000000000000..1e58fd82479b3a2ef0af271c84ca2c900e07a1c8
GIT binary patch
literal 601
zc${5O&1%~~5MCA`gjj?T#RL<A2*EhurfyGxoD@X_mDnj-k&7u}Esf0<MG~vYkB@nm
zJWAfEFVIy~x}m3?`TllhE|b-FPS)3HxLk(mPgz2Z689Is>139?H(LoRer^?Xoownk
zM}e|f!u{qWJT+x6fP3vczLa$->z#=?yO9V=R2-GYjpgJ{C@D4-TtQI@C9qM`{~;|q
zj6_u#7vqJJEzUyS?dtwV!vz`yg;44kUNkM7f1KMmGNE>WlNCG}@0w?6vbyHx7%%k1
zeiX`5;J2#52KOzn6#5OkyEx^^?aJeEl<C*alI$jCx0_#3;5aPH3_6TN2P}@3VgAkU
zP$=xdKz|%nqU(MrJ)gq;bV&TNeW;6m-Or1~*TsO%f>xkDT|E!BmDqK`sh{WXqvW}R
zI&6f^aMXDXPr+Z)>DfQgI!oi&Ec7<|M2YLT%%PMJN?u2dFzVW_b1)Q+;|~RMCYDFE
k+VaPg*w$DZJS$+t*Cah4wq`ss8r#lsPg6n<b$>+3AKXy9-2eap
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/function-001.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: RegExp/function-001.js
+ * ECMA Section: 15.7.2.1
+ * Description: Based on ECMA 2 Draft 7 February 1999
+ *
+ * Author: christine@netscape.com
+ * Date: 19 February 1999
+ */
+var SECTION = "RegExp/function-001";
+var VERSION = "ECMA_2";
+var TITLE = "RegExp( pattern, flags )";
+
+startTest();
+
+/*
+ * for each test case, verify:
+ * - verify that [[Class]] property is RegExp
+ * - prototype property should be set to RegExp.prototype
+ * - source is set to the empty string
+ * - global property is set to false
+ * - ignoreCase property is set to false
+ * - multiline property is set to false
+ * - lastIndex property is set to 0
+ */
+
+RegExp.prototype.getClassProperty = Object.prototype.toString;
+var re = new RegExp();
+
+AddTestCase(
+ "new RegExp().__proto__",
+ RegExp.prototype,
+ re.__proto__
+ );
+
+test()
new file mode 100644
index 0000000000000000000000000000000000000000..dddbac12b1abe0848fc804b407703fc8a1dadffc
GIT binary patch
literal 1763
zc$|e&@oVBp6n-7TFoY072t`CBgd%D^v0f=<_t;%+ZP(J;MRWVZl|xdUdbx{<jAM8E
zm+ilGf5Ocq>Lg`%&mYG3&HKLZy?HPF;pk=p57*<~-Cb||XE>)Z5Bba6Z@60@rr;^0
zZ18o(=z1L{aZQC29&ox8lzLC#MJz*=J(uZlc1M?wlqrHAum$Di5&fd5UO$ZIVZ2cF
zDi=W%DMIHq<dg+bKS?4Q#41to{|eU%wzs?qXTnb1>(kLDigqre&62WkrqZRWO+4cw
z=qK|R_bOq_Ao>)rU`Yjk-4e}H#_4>2HJK$VTHA>(=`0c%8M@*j0ei_!>vO=u;4z{(
z($VX?gq^;gkD5et-*kQ;?ye`{m3CA8y;#_o%viYMt^5*H_F>|WhokF>T6Y8c`g0I%
zs56Y$JcwuX{)t@ExFe6QJbsnO35mrBoCS?(_858Dvv#8}CxZ)rct5gNEa3@%Sy6N>
z8GS2x{F~1Bw7UyVES_Xr!p{LSw~ICC*OkcX{?NZ25K*Ov`lx5zr<y+)<r@~eUOn8l
z=q69DaQBY6_zK#psbjC<+0$v-#B^$iM{go-ejbb`qBm!!PM*pQR{_@;T-^1hUBc;_
zTfR6hf;IK`MZaHYZ_x1G?WtRy9F<^XFK&457baHukp^?h{Ny%SAQ#nbp=MlGtEg6f
z>2yxWa}v%U{PAF*mh_L&Zd#_MV`7yN!A|{LLk=K#YxtgLpd;O}KV`wW{VogY_8Vlt
z2!S|19wN8omcX%Zpk4*25L~NP5P+kjvWfMoUeRk#3BiqqwAz{b2C7g&1o}+^j#RoO
z`xdJ9Z%~06oJj{w7)w1VW2A%BUSgzS3jpMwc?ju`e2~Z`U}I!oiWrEIPj!HtZnIZ;
zTfDbzY2UF0sRe8l;UNKnAaA4p+~(i+Ql}e5C~R=iM*E*`Bm&JSLSds9ZLGb`Sz%Uo
zJ2#}R6k9?pRWdZ}cHX4?Ba_x^ld_TCLHV#XR;?L;Ol%&&k(tINOyCG36U4=VSiab}
zl@)HD)-y6R!OF-EPDcY;5$Z)K-1CqqsHNHh)Qb=o;VW&Y2yJuw9MD93u#Yp^2L%5C
DaV~qP
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-001.js
@@ -0,0 +1,111 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: instanceof-001.js
+ * ECMA Section: 11.8.6
+ * Description:
+ *
+ * RelationalExpression instanceof Identifier
+ *
+ * Author: christine@netscape.com
+ * Date: 2 September 1998
+ */
+var SECTION = "instanceof-001";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof"
+
+ startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object_1, object_2, expect ) {
+ result = object_1 instanceof object_2;
+
+ new TestCase(
+ SECTION,
+ "(" + object_1 + ") instanceof " + object_2,
+ expect,
+ result );
+}
+
+function Gen3(value) {
+ this.value = value;
+ this.generation = 3;
+ this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
+}
+Gen3.name = 3;
+Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
+
+function Gen2(value) {
+ this.value = value;
+ this.generation = 2;
+}
+Gen2.name = 2;
+Gen2.prototype = new Gen3();
+
+function Gen1(value) {
+ this.value = value;
+ this.generation = 1;
+}
+Gen1.name = 1;
+Gen1.prototype = new Gen2();
+
+function Gen0(value) {
+ this.value = value;
+ this.generation = 0;
+}
+Gen0.name = 0;
+Gen0.prototype = new Gen1();
+
+
+function GenA(value) {
+ this.value = value;
+ this.generation = "A";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+
+}
+GenA.prototype = new Gen0();
+GenA.name = "A";
+
+function GenB(value) {
+ this.value = value;
+ this.generation = "B";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+}
+GenB.name = "B"
+ GenB.prototype = void 0;
+
+// RelationalExpression is not an object.
+
+InstanceOf( true, Boolean, false );
+InstanceOf( new Boolean(false), Boolean, true );
+
+// __proto__ of RelationalExpression is null. should return false
+genA = new GenA();
+genA.__proto__ = null;
+
+InstanceOf( genA, GenA, false );
+
+// RelationalExpression.__proto__ == (but not ===) Identifier.prototype
+
+InstanceOf( new Gen2(), Gen0, false );
+InstanceOf( new Gen2(), Gen1, false );
+InstanceOf( new Gen2(), Gen2, true );
+InstanceOf( new Gen2(), Gen3, true );
+
+// RelationalExpression.__proto__.__proto__ === Identifier.prototype
+InstanceOf( new Gen0(), Gen0, true );
+InstanceOf( new Gen0(), Gen1, true );
+InstanceOf( new Gen0(), Gen2, true );
+InstanceOf( new Gen0(), Gen3, true );
+
+InstanceOf( new Gen0(), Object, true );
+InstanceOf( new Gen0(), Function, false );
+
+InstanceOf( Gen0, Function, true );
+InstanceOf( Gen0, Object, true );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..8ae4c2875dfa932e74e8ed1780e453d4b2881ce8
GIT binary patch
literal 1977
zc$}3~4~ybP6rT$r3_}PZ1hI=qDvP+*iij-B^*mO0-8+xfT~zkk+iUF@N6lSK>}0lA
z%h7Mw&(g2aH!&uj(3biqzWKfPe!ur;u-hNL8KcKnqt0N^8U5(ZSs*;I{q8ILywZ;k
z3y<;MZyU~{$P0sVW{w3FYz-kbX?gB|t!Ia!rLGsuy<nNq)Neh(IQ7SZ1D-`X5J~wq
z1ITpv<ohQ>_9??E9r#%WQZNHA4yChz3FS*B8i`yt41Gp}EUPeCc~N%E-#i7b0HYhu
zx8?oenz=sZRGQ9B$k)`rhvS+7WmLGLzMm1CK2Yw_na}n)Auk_85LSZ%85eAx5{=z(
z!-^v&o_ID+()C04V>KyW4kA;^^%rSe>$u-+(8Uht^kANilx)qo=N?Sr?aK36N~w=s
z?rns#FBF=HOMDzpM*ZQdadtocBr9t=-SAL^)2T7;T}}FTLv2HaIbo5wq7lOZ^k}^e
z`A5dPj9GE4*lrk}vyCu&>y00788dsq(hC^l1Oh%pYP+q6vk%M_wiiT#1}+O1cm{mN
znz}29%#EqfqI=jv7^t5=Yrj%%3}`@?Kr!i0ZhJX5giQYA!WxW+-e?S!+5Lp<Zh`c>
zm|ywk`daQ_?FDcdoqd2aVt%}>Xyt7p_3O6YyBc(+O@p&d$VEir(P9Bz-axzcbO=tn
z?d*H0r_Ht?#>qNy(s?*%7e}sxzML~tP6MipaxCG5B8?>r<Qkn%9QOH|(K+Lj@HSi)
zGMaB2jiv<$F61J}FHfPM^&_QynSXrIz`t9vz1`rl=6?Sl`Cl>xaI2fgRV6pVIa8eD
zig(J+S@55V@fs4QtWpxm;lBTeY?+fTCQEvpjC#F;zeI9=Vd$n+FFS-_rBYKh)g(wk
zf8q1esjfJhg70@m4L{!*6@0D~(MUn?9Oe|#A}yrgpHSrlp;Jw*<`sl=tzICime;B}
z9EWO)T%dflqPNr<$)UW8s(MAoO4)v<D`p+ec~rL1j=;b%fhh^FW=Mj%s+d*|lM=$X
zAx#5J1K&b|u50Cjf@GAXNY{%7RAySJtQ*KwVoqSec1%hNh9*fhTPAchnNWbRqM8Fa
zgpnbU*T8NY=;e-xq(q?QBwDq&A_LFm&!mas*AJI6-hp_s7cM5k)=t>giZc5$5hk&)
zp+Q@3kS(zyNEhQCk+tI~omwz-)qwVpVj!)AVcK2$8Of<gzAas%Wr;3gRD$p!F<zDU
zY=_4V_?oe&E<N8To}CLG&Dd9yzIS_H;zU*HI+3miaGgl)6uC|ik|OUD#7vQ&6Qr3U
OH#Uk92d>hkg8l|w))dJA
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-002.js
@@ -0,0 +1,127 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: instanceof-002.js
+ Section:
+ Description: Determining Instance Relationships
+
+ This test is the same as js1_3/inherit/proto-002, except that it uses
+ the builtin instanceof operator rather than a user-defined function
+ called InstanceOf.
+
+ This tests Object Hierarchy and Inheritance, as described in the document
+ Object Hierarchy and Inheritance in JavaScript, last modified on 12/18/97
+ 15:19:34 on http://devedge.netscape.com/. Current URL:
+ http://devedge.netscape.com/docs/manuals/communicator/jsobj/contents.htm
+
+ This tests the syntax ObjectName.prototype = new PrototypeObject using the
+ Employee example in the document referenced above.
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+// onerror = err;
+
+var SECTION = "instanceof-002";
+var VERSION = "ECMA_2";
+var TITLE = "Determining Instance Relationships";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object, constructor ) {
+ while ( object != null ) {
+ if ( object == constructor.prototype ) {
+ return true;
+ }
+ object = object.__proto__;
+ }
+ return false;
+}
+
+function Employee ( name, dept ) {
+ this.name = name || "";
+ this.dept = dept || "general";
+}
+
+function Manager () {
+ this.reports = [];
+}
+Manager.prototype = new Employee();
+
+function WorkerBee ( name, dept, projs ) {
+ this.base = Employee;
+ this.base( name, dept)
+ this.projects = projs || new Array();
+}
+WorkerBee.prototype = new Employee();
+
+function SalesPerson () {
+ this.dept = "sales";
+ this.quota = 100;
+}
+SalesPerson.prototype = new WorkerBee();
+
+function Engineer ( name, projs, machine ) {
+ this.base = WorkerBee;
+ this.base( name, "engineering", projs )
+ this.machine = machine || "";
+}
+Engineer.prototype = new WorkerBee();
+
+var pat = new Engineer();
+
+new TestCase( SECTION,
+ "pat.__proto__ == Engineer.prototype",
+ true,
+ pat.__proto__ == Engineer.prototype );
+
+new TestCase( SECTION,
+ "pat.__proto__.__proto__ == WorkerBee.prototype",
+ true,
+ pat.__proto__.__proto__ == WorkerBee.prototype );
+
+new TestCase( SECTION,
+ "pat.__proto__.__proto__.__proto__ == Employee.prototype",
+ true,
+ pat.__proto__.__proto__.__proto__ == Employee.prototype );
+
+new TestCase( SECTION,
+ "pat.__proto__.__proto__.__proto__.__proto__ == Object.prototype",
+ true,
+ pat.__proto__.__proto__.__proto__.__proto__ == Object.prototype );
+
+new TestCase( SECTION,
+ "pat.__proto__.__proto__.__proto__.__proto__.__proto__ == null",
+ true,
+ pat.__proto__.__proto__.__proto__.__proto__.__proto__ == null );
+
+new TestCase( SECTION,
+ "pat instanceof Engineer",
+ true,
+ pat instanceof Engineer );
+
+new TestCase( SECTION,
+ "pat instanceof WorkerBee )",
+ true,
+ pat instanceof WorkerBee );
+
+new TestCase( SECTION,
+ "pat instanceof Employee )",
+ true,
+ pat instanceof Employee );
+
+new TestCase( SECTION,
+ "pat instanceof Object )",
+ true,
+ pat instanceof Object );
+
+new TestCase( SECTION,
+ "pat instanceof SalesPerson )",
+ false,
+ pat instanceof SalesPerson );
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..f64bc628b19b66d8ee9805cd2e9d8321fed2a152
GIT binary patch
literal 1572
zc$|e&?P}Xd6uljU7zQDPFvb`Y1`&*txW-LG3A;;Me<-O#;s#3_mJN$h?6FsitTE$p
z+B`#_p^wye*+<wJe@PB)*FUcBopaBbbML6#>t6+Me>rH~+_VON#bcJrSU&yw#cbAk
zt6~x};eVbBwpheGt!8N;Bgtl}rPfmQG}UQ_o@+QB-LTmM6InwTi7As_J5I-OI?Zlq
zT*s1$C<&xc=b20;{5xJ`B^maYNz&Xj_m?v!;!y^d`|MLzl`fX)NUEgG$4~Tvi&>Q1
zMk1Oq#a`5vDJCQv?~Z~IpR?+g)McYYAv&eXZX}*^t~ybY<d$+5i8y*lSdMe{eCBM{
z!{_Z>Y$s}Sp0Fs*q^)2i;<>Enx0#`IJA+bOxj*=Q-{^f14to8|AbZ%Qc}E_jWXTFs
zma?^1oT>%jOO`g>x!{t^r#V9>cHnoy-p9TMUh8nG!z&%yj^yi?a`?kPY$S&(thKFP
zIomCguoqtY7W+I`=jLN13cYk8qjbbRP6!i%3)KEoFu4>d^=k13qkKY@o_8YE>o+o^
zC*F}~snM2+M6JTMn@{XJe-J3E#jYQ82EAKtyL?2m2Ksh)$3|3-eB#ly;Uh2H;orY^
zr*-7H!{KU6!=V$hh3rHNhA90c)C+!K(U^&lU-N11@|Vr#>zAqJcWzq4Q&*h|sfp*=
z7eV6%O}V5Ioox2z_<!80_4{2^!%{WlM;?#w!-4N-Px%ek>W*!?j$JNPv1!pW16hFJ
zD?X=(7COWhxmYJ><ik3l<P;si6#^BzMN}ab0v2flEd!LW=~YSyz{b_0ZQ=?pVb3lg
zxH6F8H7ci2ff91z{V@hhGb@DLLWP_|2|Q?M1w#pIzFjmC2F>l7$S^Gc(0|B*)epbd
zRndh56OrFk4z`hpj=_GrL4V21Iy>3A@f}&vTyTv261!j{$ji7tm-+Xd=DEgxsbrje
z8S{VK=n70@zf>~rzD#*1^JZ^Xq?ub%U6ad-Y@(G;*&xllNa05!$InFy#_9|TxDn>8
Yd2h(IihWX3Uq;n7t1qfAR`~$Ie^-=w+W-In
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-003-n.js
@@ -0,0 +1,88 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: instanceof-001.js
+ * ECMA Section: 11.8.6
+ * Description:
+ *
+ * RelationalExpression instanceof Identifier
+ *
+ * Author: christine@netscape.com
+ * Date: 2 September 1998
+ */
+var SECTION = "instanceof-003-n";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof"
+
+ startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object_1, object_2, expect ) {
+
+ result = object_1 instanceof object_2;
+
+ new TestCase(
+ SECTION,
+ "(" + object_1 + ") instanceof " + object_2,
+ expect,
+ result );
+}
+
+function Gen3(value) {
+ this.value = value;
+ this.generation = 3;
+ this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
+}
+Gen3.name = 3;
+Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
+
+function Gen2(value) {
+ this.value = value;
+ this.generation = 2;
+}
+Gen2.name = 2;
+Gen2.prototype = new Gen3();
+
+function Gen1(value) {
+ this.value = value;
+ this.generation = 1;
+}
+Gen1.name = 1;
+Gen1.prototype = new Gen2();
+
+function Gen0(value) {
+ this.value = value;
+ this.generation = 0;
+}
+Gen0.name = 0;
+Gen0.prototype = new Gen1();
+
+
+function GenA(value) {
+ this.value = value;
+ this.generation = "A";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+
+}
+GenA.prototype = new Gen0();
+GenA.name = "A";
+
+function GenB(value) {
+ this.value = value;
+ this.generation = "B";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+}
+GenB.name = "B"
+ GenB.prototype = void 0;
+
+// Identifier is not a function
+DESCRIPTION = "Identifier is not a function";
+EXPECTED = "error";
+
+InstanceOf( true, true, "error" );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..6dc8c4a9f1f90f103d986e2d0d0db752cb2d1fca
GIT binary patch
literal 1585
zc$|fj>uTFb6oAhTMht@x!Wd(MF@p%fNnGP*LkZi`))yspNZeqlp)@RJVvoHlvc`<Z
zY4ZU6)d$%}+Sk}e*csm>hi>a1$LIQ;%c#}uT?TM>(QjT~H~W7^Bc7;8J-+;IHLBgE
zF^;(Ozs@9|&m)l>q-vm;;!~YcZEAax7&VQanQ%0`=F@vF(}a-830Gb#N=8vKNjuc9
zBE=<(10}UT#gxOpqIqhPL2nVqdp-Uo^)=R|y~UKvXqcJxe31;5RyuqbGs%of&xM?_
z_(q#kuFK{%JsX#bkG8I0C}zC0scnhTBh}+F`Iwoi&Eh!I=$6Td-N!uB==AB%>8|@v
z(}mpZ&=Ml%EJ@LJFqF|uRX*$vP|IF7b<@o<y2EmfyCCd$dly0au-~kY<blNtjuX9Z
zVZsx>8rTW^cG!L2!xua`G2(Y4p66#$D4`x_+?Wk??27x(e5eM`H_9@(>240@DzSP*
z<8G0#8(#S~|2osDg>EueEE)3mW9xxQ!le|_x%K;j?puh~K{2-VI*VAL7HWQyTrFfm
zz3L`R#h7ZccdYc6QBUVT_71(hLz+@3s=6Vct2Uc+{2-!{v%c=@EprVqmpJz5YM(<d
zKNu{R9t>Rn<Bh(G-$9gqk@|_=aW>*I6jx%B*L|ci4Y1O}_S@IZ!AYk7vqt0eS#p-X
zJB{Wv5sET8Uf-(N@q>21dt>e%Zm0V3c3bkHcNg}3KYh}FaJB9_u8m2lvX3o`9_5e)
z2>!-r^uR{iMQ&Eg5$UZIN@}PAmk6|cS48D}IS&>&2U-9qVaqEN5rBjDi;jg0xQIPx
z55Z*)<-B^i1_dZ07ydZHV42Eto}58}ynrHjP&b5}2Ag_Pv=9bU+p$p2vH`&S<?^un
z;kU*ryRc^=a;tS9C>yE)X|1Dgvsk>v)^b0<f~f_Jc1_3CbjV`tpJV=gW9n?QYibPM
z#kjwi##rE@T~lN1T})|<d9iaVa*{dHsVOe$VizqrB}7iLkjno-8c!h=wDdv6IeL{D
c%?n9i%MPjPFJr%Cx$xRT2frP_(s700KXi3{M*si-
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-004-n.js
@@ -0,0 +1,88 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: instanceof-001.js
+ * ECMA Section: 11.8.6
+ * Description:
+ *
+ * RelationalExpression instanceof Identifier
+ *
+ * Author: christine@netscape.com
+ * Date: 2 September 1998
+ */
+var SECTION = "instanceof-004-n";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof"
+
+ startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object_1, object_2, expect ) {
+ result = object_1 instanceof object_2;
+
+ new TestCase(
+ SECTION,
+ "(" + object_1 + ") instanceof " + object_2,
+ expect,
+ result );
+}
+
+function Gen3(value) {
+ this.value = value;
+ this.generation = 3;
+ this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
+}
+Gen3.name = 3;
+Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
+
+function Gen2(value) {
+ this.value = value;
+ this.generation = 2;
+}
+Gen2.name = 2;
+Gen2.prototype = new Gen3();
+
+function Gen1(value) {
+ this.value = value;
+ this.generation = 1;
+}
+Gen1.name = 1;
+Gen1.prototype = new Gen2();
+
+function Gen0(value) {
+ this.value = value;
+ this.generation = 0;
+}
+Gen0.name = 0;
+Gen0.prototype = new Gen1();
+
+
+function GenA(value) {
+ this.value = value;
+ this.generation = "A";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+
+}
+GenA.prototype = new Gen0();
+GenA.name = "A";
+
+function GenB(value) {
+ this.value = value;
+ this.generation = "B";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+}
+GenB.name = "B"
+ GenB.prototype = void 0;
+
+// Identifier is not a function
+
+DESCRIPTION = "Identifier is not a function";
+EXPECTED = "error";
+
+InstanceOf( new Boolean(true), false, "error" );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..630f763602c3e3239f5ffcdd46a4ca848c2edb10
GIT binary patch
literal 1588
zc$|e&?P}Xd6uk^W41+Mjh+vE{gD}BK+~9iC657(%A4=+wxWUqf-3^PG*ke~kmdtpZ
zHvju3eUd&yU!;%F8GlI*?XG`}?>YD0Gw0q>tJ}Nq;r6`Wyt-=k{|!exmZ5xj`L}so
z?JmJM<ih(r6MQ}olXyQ3eaR%Bs*-9`;YqB+G<&Mk;qZ!2@3=?{0wyM0x~(uCh4Cc4
z;rKF?T(HQOLh-3gDfkf1Q%DBAMHCf#{8P%+*R8$9l#6hf@p`t1hf)O{K8%=PIxK9s
zRx*01DPLSjKDt)fDOW1~Fqv_BmWU~fw&a{DyG%S}T(wygrSRnOeCb^KH%x@=F5(#v
zmB(Bn=*EdkEj?KNP=qsC{&V-@T6U``ed`DPZtvVr-|w4wL+)9$;5b%8;By|goC%Nl
z$^kmk%u{{*k)Me~Ch}pntZL+ZuN`#X_cW;6n{C<2-A6u@gNCM?woF#<w4t9`{PRo&
zPB)%Q77zLRF$ucCrDxtV@sHqgA!6!Q!*!M>W2$uABdH$uIJI@;9=NFKY|4@`;X)(=
zwQ@IJ-&dwAHSZ#l`N3dmdN8oPzpj;EuY)C@%i;k|dnvw8!jT;)zRl(w(Y(qCsqyQr
zqqPOSqa&BDra5rGr0++=Ic0RbUPFy;m!)UeEsGOLS-cjpy!KUd(4e1$`Z(WlHsT^k
zE|UqW2HVSjy@Krs2ku_S^V|LIwSJGxWKZh#XHVkWpznF<gMY`>eLLq6+bS9^HuIH+
zf%1UhD?WAiEmXmI60Cv-xmX1iQbT3vAW-M!9xCAyhCFFO#Q`W_la>nzAcx&z&ctP0
zz%;jq;KD!#Jt@_o3<YGv+e6i(J4=}KpiEvt0Vtek1w#qzeyeCA47#^tBEz%*K>wL}
zSpM)^jY>A`nTTAg7%Y@c)xdhb&Yopu?X7Ih_=PO!Ua-+F%-KpEvNGhqWq!QTeFW`7
zC1dZ(IRE2DBXH0zR5D~&rnr@PzOyTGm|0R)Hy2g2gO)l)L=Lke#_vSxk3|f$<iN-s
czRp;qeezD7r{q|D8Lng6st~|f!WRgB0(O9Y7ytkO
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-005-n.js
@@ -0,0 +1,89 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: instanceof-001.js
+ * ECMA Section: 11.8.6
+ * Description:
+ *
+ * RelationalExpression instanceof Identifier
+ *
+ * Author: christine@netscape.com
+ * Date: 2 September 1998
+ */
+var SECTION = "instanceof-005-n";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof"
+
+ startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object_1, object_2, expect ) {
+ result = object_1 instanceof object_2;
+
+ new TestCase(
+ SECTION,
+ "(" + object_1 + ") instanceof " + object_2,
+ expect,
+ result );
+}
+
+function Gen3(value) {
+ this.value = value;
+ this.generation = 3;
+ this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
+}
+Gen3.name = 3;
+Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
+
+function Gen2(value) {
+ this.value = value;
+ this.generation = 2;
+}
+Gen2.name = 2;
+Gen2.prototype = new Gen3();
+
+function Gen1(value) {
+ this.value = value;
+ this.generation = 1;
+}
+Gen1.name = 1;
+Gen1.prototype = new Gen2();
+
+function Gen0(value) {
+ this.value = value;
+ this.generation = 0;
+}
+Gen0.name = 0;
+Gen0.prototype = new Gen1();
+
+
+function GenA(value) {
+ this.value = value;
+ this.generation = "A";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+
+}
+GenA.prototype = new Gen0();
+GenA.name = "A";
+
+function GenB(value) {
+ this.value = value;
+ this.generation = "B";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+}
+GenB.name = "B"
+ GenB.prototype = void 0;
+
+
+// Identifier is a function, prototype of Identifier is not an object
+
+DESCRIPTION = "Identifier is a function, prototype of Identifier is not an object";
+EXPECTED = "error";
+
+InstanceOf( new GenB(), GenB, "error" );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..7cbb912b74563f6d165c415fd127d22ec00e5972
GIT binary patch
literal 1515
zc$|e&>uMT76h0l6VUT6miipS}%OYYDD<%ygv?YxuCNU%?xZD0{D6-Ls-Lme=IOg&U
z{n1D2EA<gN<83sgtv}Xt&Ue{w&TOOAKKJ0}v{S#ltarYKeHM#QJiY&cYvtCoxeFO@
zK8`pWkHaJ`>CzK{U_(hM*JVG5RjJW^1&6&$HoRqA6a0V=m~b0m+z;b{euM3Q3&&cW
z>b56QRJ{lV<3Z#JF3B3rx7ma4YI9b5GGsjLX&`qpiF-m8jimonkr@~ltbZNwV92Dx
z>m?&rT5yh8FOrBVos)zQgJ?+{J2Gy-pR}`m6hzU=Qa%Sf3~nQ~Vp4oQOZXyaBS|6_
z#9Cij-IX3Yi^$Sy8g}>j9`*hTpVkwaUXO<(apU=&R{PY`7yBAtr|yGj!ZHIEvsqRW
z%Y%|r7Qao8cp?(<G-7B=4Yt)|M?GrPYaaQntF~(DR&x8D^+b1jQS4YEnO&2@8`fg2
zCVL!7JkyHDB8YqJ>JHxrJmt6ii>4{FP9i}+H#?p*M)gcMXC-%Zz9iK6!kL)x*m27X
z)Jg6f`4V?a$Zw{qkFn)$xMuU{vfkbCm!g-6&cbWMJy=rbJhcqTm>q1xC4!BG^T6fZ
zow1<LxSw1kgS3=$;Y*0zCt*L`?M^q>?dCTeeF_ITmf{=*V`l5|n_6ufm2dn`v#BrU
z7paylYMB&gY?t74Y12SyK=707Iz<z?Buy`7#U|aG6(w3l1vo??p9fiFr|cA@=^2!A
z09k^aYz_gK#LZJovLr_wGlSsVK*na-u0j@a$b$1t0%@hRQ?w0PdIC9cpsXAWX{_`(
zj}ZZ-J;unuDF9G^GTrn?4po=8pnwtGmo;Ex6)FKfo}=$pZRygsV!U7rN(<CjZ;1sM
z!K#h<Z=2sAmCiKQTWLerZLI&KQ5{&udMj<rb(_r6W^Zj*w6e0KT_w&)v4y5S8G}|<
kP3*s!>^wKIjp+<*QfcUD1#olNf*M9efLigD9DG3V2lPp2lmGw#
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/extensions/instanceof-006.js
@@ -0,0 +1,86 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: instanceof-001.js
+ * ECMA Section: 11.8.6
+ * Description:
+ *
+ * RelationalExpression instanceof Identifier
+ *
+ * Author: christine@netscape.com
+ * Date: 2 September 1998
+ */
+var SECTION = "instanceof-001";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof"
+
+ startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+function InstanceOf( object_1, object_2, expect ) {
+ result = object_1 instanceof object_2;
+
+ new TestCase(
+ SECTION,
+ "(" + object_1 + ") instanceof " + object_2,
+ expect,
+ result );
+}
+
+function Gen3(value) {
+ this.value = value;
+ this.generation = 3;
+ this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
+}
+Gen3.name = 3;
+Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
+
+function Gen2(value) {
+ this.value = value;
+ this.generation = 2;
+}
+Gen2.name = 2;
+Gen2.prototype = new Gen3();
+
+function Gen1(value) {
+ this.value = value;
+ this.generation = 1;
+}
+Gen1.name = 1;
+Gen1.prototype = new Gen2();
+
+function Gen0(value) {
+ this.value = value;
+ this.generation = 0;
+}
+Gen0.name = 0;
+Gen0.prototype = new Gen1();
+
+
+function GenA(value) {
+ this.value = value;
+ this.generation = "A";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+
+}
+GenA.prototype = new Gen0();
+GenA.name = "A";
+
+function GenB(value) {
+ this.value = value;
+ this.generation = "B";
+ this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
+}
+GenB.name = "B"
+ GenB.prototype = void 0;
+
+// RelationalExpression is not an object.
+
+// InstanceOf( true, Boolean, false );
+InstanceOf( new Boolean(false), Boolean, true );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..c6468135c7ed20f4230312cf461dd990a3dd9bb1
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;fnVw&B@^jPA<wUD2WaZ3G(!F4@M|p
RVu%h2a&<)r@GvoeAOIvs7^naM
new file mode 100644
index 0000000000000000000000000000000000000000..a2ae3f54806a329ff2f16a54dd7a59cad4d89df3
GIT binary patch
literal 592
zc${63-%7(U6vpFWlrlmYWsEU~1d*Z$BHj)!wpp~YO=!w)hDh3-jYw@r8k}DGP`-zc
z;v*PcG3re?=l6Z*Uq;dFhLgorJe*F4@ts^^p{0Hqyg~OU`c767RrtJ7SXHttPA5{M
z5;@mO7Hi7`8*(i)KAO_QxlmH1IbLFx3ng@^g8#_)4@R<Bnr3z!GeoEt+p;&qt<Cyl
zk>@r&t5+J8Wsah-0_B;K8_kAQg-YYn%;s6S!39s^Xm-WzwXYC(JRB#{?aX-+3esj0
zC6f?NS_xKqEGqQoVa$!})l=HCsI(|DELZe4eZWl9a6BE}p95oCWfr<du|$=WlX6Xh
zlvz95+2>{sOW6f0aLekZN5=#9$6E8?7c%>Q|D<n-(qHSj+B}OS4nup;N4o>0=@N%F
zfDj<>z6%tbCV}2ApwQk04zNax8~`zIw*%Crt|{mc#|7WW4Uc$6^GLJz#rOR^+9D0&
N{g8f5d{ci2<P#4;ur>ey
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/instanceof/instanceof-001.js
@@ -0,0 +1,34 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: instanceof-1.js
+ ECMA Section:
+ Description: instanceof operator
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof operator";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var b = new Boolean();
+
+new TestCase( SECTION,
+ "var b = new Boolean(); b instanceof Boolean",
+ true,
+ b instanceof Boolean );
+
+new TestCase( SECTION,
+ "b instanceof Object",
+ true,
+ b instanceof Object );
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..abd6b25a0d77487c26ac85b604fc753b0dcda593
GIT binary patch
literal 724
zc${sKUu)t(6vd~5gb+fIAmU0{h9ctrK}ugsA7VDNS=2%%_##W0#M^e3Y$B8Cx_+?z
ze!Xhek#=8_JHLC*nR}B-Jpazg@-_)(vmp5)S5RuHx7UAZZxrtjj}lb$XRV;FWmS%+
zQiBo&*GiU8h7V22wb1Yjt!yGop|+-T*_bC)Re&f>qd$j@IbEP{h3V%0;X)`WvI4$A
zUI-;Lss?XarOrc96eh>zxsq$mg1QE!VTA^sS8G`EG>PZ8+-&=yHTHNErt$rpW*u49
zT9i3dkL?s{9f}&P-$HrK*iIU!)5u#y2}iwqpZ$bf(=WD0?O3Z9U?zYyo<VjB1Es{4
zGH3t3Y9yzELnaw!@8KwY2DaOig%$SHOOA^#a6Fc=8&<;R-<6|J*DU+bC~TwfFWiAx
zfl8}s_2fq3EO@x`QK<B8;bodck@+|ew9}=;v5D(ZN(d!4wCC9_ZM%fBL*dcShr*?U
zmQTJ?g3nQxTE69@qmNeG$2N6{gFS~>eH;1EKC@aF=p4yKL)u5uv&o*EA4zvd?6VWs
N$GyuzmrpvByaK@c%qRc=
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/instanceof/instanceof-002.js
@@ -0,0 +1,51 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name:
+ ECMA Section:
+ Description: Call Objects
+
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+*/
+var SECTION = "";
+var VERSION = "ECMA_2";
+var TITLE = "The Call Constructor";
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+var b = new Boolean();
+
+new TestCase( SECTION,
+ "var b = new Boolean(); b instanceof Boolean",
+ true,
+ b instanceof Boolean );
+
+new TestCase( SECTION,
+ "b instanceof Object",
+ true,
+ b instanceof Object );
+
+new TestCase( SECTION,
+ "b instanceof Array",
+ false,
+ b instanceof Array );
+
+new TestCase( SECTION,
+ "true instanceof Boolean",
+ false,
+ true instanceof Boolean );
+
+new TestCase( SECTION,
+ "Boolean instanceof Object",
+ true,
+ Boolean instanceof Object );
+test();
+
new file mode 100644
index 0000000000000000000000000000000000000000..9c8c454036777241a0ac80e6c59526fafe9e7b94
GIT binary patch
literal 905
zc${5P?~B?%5M724LXaRLsfb7r5qoE?^sYZZ`oY*JmeVUH-WMsyUL3u&F&j2(skHsy
zyZ&6cZ!>S+y!Uq29ZkOaWImks#^c`fd$hnrL}J^$*4xd|zF9`dz27OvEQ?suzKaBM
z8vBAr$x7i3Rr-PoT+7v(8zl?LQaa}2WE01Y2g)P*6yp~RW6G(JOO-y2W2I4lNnzZP
zYLssk$GLy{fuT@<>BcPl+3d+?mFxnjQN>%QVtY>JNDgv=3u)trEJbI)_?pJwq}3Yb
z1GC0plZ3lq7a2e8_M>o&>nG&OC7^tTq89LNpNjDLY|=TN%4IA@ny4^2Kjcv=N+%1K
zEw=W4w;$6@hPN-Z)dA;zFda>XzWS(FT3i1`IWT>|nB7|}0?b68W|$Yxm~tkViJUXu
zV$Nsh&%dt2oG8fzO+sW#hglEa)F0hX3hrz;nT=g<YWZG2kVsL{%wQDUc?H>Wv6C<C
zb;UNt#-&z@`;Yp&JibdFl{H@<ZBJ>AtsJ$_DiS-5yG}((zUg#sjE^5~-simjxcB(3
zeHOW}l}dncZ3r1`9!xz?-DU=jvIbht%ol76fDj;Wp=^>ISb71RLt#PvP}op86nUs=
zIZ^^rCB!gvtpdbof?O_XcFQOL(QJokWnxH{Ue)tgP=!XF<cq{0nn^4v0g_cK8a3Ea
aY#nl7%CXeA(wjx2yoaql45qAGK>h;`XA{i;
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/instanceof/instanceof-003.js
@@ -0,0 +1,65 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ File Name: instanceof-003.js
+ ECMA Section:
+ Description: http://bugzilla.mozilla.org/show_bug.cgi?id=7635
+
+ js> function Foo() {}
+ js> theproto = {};
+ [object Object]
+ js> Foo.prototype = theproto
+ [object Object]
+ js> theproto instanceof Foo
+ true
+
+ I think this should be 'false'
+
+
+ Author: christine@netscape.com
+ Date: 12 november 1997
+
+ Modified to conform to ECMA3
+ https://bugzilla.mozilla.org/show_bug.cgi?id=281606
+*/
+var SECTION = "instanceof-003";
+var VERSION = "ECMA_2";
+var TITLE = "instanceof operator";
+var BUGNUMBER ="7635";
+
+startTest();
+
+function Foo() {};
+theproto = {};
+Foo.prototype = theproto;
+
+AddTestCase(
+ "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " +
+ "theproto instanceof Foo",
+ false,
+ theproto instanceof Foo );
+
+
+var o = {};
+
+// https://bugzilla.mozilla.org/show_bug.cgi?id=281606
+try
+{
+ AddTestCase(
+ "o = {}; o instanceof o",
+ "error",
+ o instanceof o );
+}
+catch(e)
+{
+ AddTestCase(
+ "o = {}; o instanceof o",
+ "error",
+ "error" );
+}
+
+test();
new file mode 100644
index 0000000000000000000000000000000000000000..16878022f6cb9802fa95bf40adffe418b66f1cc0
GIT binary patch
literal 860
zc${5P(TdtY6di^z4HAL`5s_sXtcd&2ZE3r0LHb~96pLm{lHC_6%b48QDKR6Hv0GdE
zJN>WzNhi8)WS?^Hx#ym9?!=w?pF^~m1jG4!7<}ak<ch1^;Gfa&PxnpAL3%$o5{iP0
zyjPW>VhYxp(s6m7@O)MAFK1kVWLc=B#!t3yndEGl!6%3_CYjP$_bDdi*@$IXwN<<G
zw^>HD3zNGF?ho~6m6r)B@YRE}D?|n?uLf@`cEscgRF&2WW63wF?ZbV=r`OBx5T7Ww
z#@jqD1G^&GeJGFT@f_AmkWZDV20$uE^krczHbBQhu37d)U$+Jwujn1MPTpY=M#0pd
zgw;QIY4pfg2=ar;2G0w{@)$&l)4KWw8!41%4wEE;LXB7fcIb_w>9t>rrqRr^Z@nPY
zo#Wn2{F}M!1?KyAZ>}6IB2~FE)1ow`A88Kv^q8i9G0<3LMN?<*qjnppKSmB<b$lbG
zm1rs?b+@ZuJj)n;UfP%?{x^MC(ASIp1^xYJK##$-Z`ta><)eYdj^h*JNf^zxywQAk
z_j(Zpo>#ro3*71$7+E#Pvg-sRgwZqHHnD|khDD4+Q77F)VUzPi;gANlP!ppbLbh$7
zE=Kk_*2~ywnrG#QBGg7Et{ceIq86$(3F$P@p*OLkMMxW!)WfW`pAkfKPcixr>!k^F
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/instanceof/regress-7635.js
@@ -0,0 +1,55 @@
+/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+/**
+ * File Name: regress-7635.js
+ * Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=7635
+ * Description: instanceof tweaks
+ * Author:
+ */
+
+var SECTION = "instanceof"; // provide a document reference (ie, ECMA section)
+var VERSION = "ECMA_2"; // Version of JavaScript or ECMA
+var TITLE = "Regression test for Bugzilla #7635"; // Provide ECMA section title or a description
+var BUGNUMBER = "7635"; // Provide URL to bugsplat or bugzilla report
+
+startTest(); // leave this alone
+
+/*
+ * Calls to AddTestCase here. AddTestCase is a function that is defined
+ * in shell.js and takes three arguments:
+ * - a string representation of what is being tested
+ * - the expected result
+ * - the actual result
+ *
+ * For example, a test might look like this:
+ *
+ * var zip = /[\d]{5}$/;
+ *
+ * AddTestCase(
+ * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test
+ * "02134", // expected result
+ * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result
+ *
+ */
+
+function Foo() {}
+theproto = {};
+Foo.prototype = theproto
+ theproto instanceof Foo
+
+
+ AddTestCase( "function Foo() {}; theproto = {}; Foo.prototype = theproto; theproto instanceof Foo",
+ false,
+ theproto instanceof Foo );
+
+var f = new Function();
+
+AddTestCase( "var f = new Function(); f instanceof f", false, f instanceof f );
+
+
+test(); // leave this alone. this executes the test cases and
+// displays results.
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..41e482dbdbbc37c67738036633a92d24576716b7
GIT binary patch
literal 81
zc${<c^z#a4h;|Qh^!0TNip@+(%`3?)skD}1;R#MI$}A}1iuWtc$%zgQ3G(!F4@M|p
UVu%h2a&<)r@GvkjF)%Rz03|ONr~m)}
new file mode 100644
index 0000000000000000000000000000000000000000..cdc222b068e0e87aba8bfa4395f5e949da8e2e47
GIT binary patch
literal 348
zc${61O-sZu5Qal2rIb>Zo;`@j;>m+oPi+k)vaOJ0_fkZ%?I?lTmSm9i>Mu8_OTf!~
zywA)#Q}OOmlD-jT+m_<lj4-3Y&wECT?Lk|kj}tt=FlnpNEc5k$ZLzmIgJAU}(VF><
zomLCZ`O&M&%%fNMkL9ZYyA4pHMtJw&Cg4CXYCTP%y)2yri!l1*a#&W#<Y3K;y;OpC
zjSOF(iuglYQdIk<+qV@Hsp4wK@&gl+KXtiewemS*bz8pN6%MsU1r8JRp;v;j;Pti1
mDM^zkjT1@;CC7}AjM6xb=x>oke@c8-qKGD0>eqbSQ1T5Tl4kk<
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/binast/parser/multipart/spidermonkey/ecma_2/template.js
@@ -0,0 +1,26 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ * Contributor:
+ */
+
+
+/**
+ * File Name: template.js
+ * Reference: ** replace with bugzilla URL or document reference **
+ * Description: ** replace with description of test **
+ * Author: ** replace with your e-mail address **
+ */
+
+var SECTION = ""; // if ECMA test, provide section number
+var VERSION = "ECMA_2"; // Version of JavaScript or ECMA
+var TITLE = ""; // Provide ECMA section title or description
+var BUGNUMBER = ""; // Provide URL to bugsplat or bugzilla report
+
+startTest(); // leave this alone
+
+
+/* Calls to AddTestCase here */
+
+test(); // leave this alone
--- a/js/src/jsapi-tests/testBinASTReader.cpp
+++ b/js/src/jsapi-tests/testBinASTReader.cpp
@@ -50,32 +50,36 @@ readFull(JSContext* cx, const char* path
readFull(path, intermediate);
if (!buf.appendAll(intermediate))
MOZ_CRASH("Couldn't read data");
}
// Invariant: `path` must end with directory separator.
template<typename Tok> void
-runTestFromPath<Tok>(JSContext* cx, const char* path)
+runTestFromPath(JSContext* cx, const char* path, const char* altPath)
{
const char BIN_SUFFIX[] = ".binjs";
const char TXT_SUFFIX[] = ".js";
fprintf(stderr, "runTestFromPath: entering directory '%s'\n", path);
const size_t pathlen = strlen(path);
#if defined(XP_UNIX)
MOZ_ASSERT(path[pathlen - 1] == '/');
// Read the list of files in the directory.
enterJsDirectory();
DIR* dir = opendir(path);
exitJsDirectory();
- if (!dir)
+ if (!dir) {
+ if (altPath)
+ return runTestFromPath<Tok>(cx, altPath, nullptr);
+
MOZ_CRASH("Couldn't open directory");
+ }
while (auto entry = readdir(dir)) {
const char* d_name = entry->d_name;
const bool isDirectory = entry->d_type == DT_DIR;
#elif defined(XP_WIN)
@@ -111,17 +115,17 @@ runTestFromPath<Tok>(JSContext* cx, cons
MOZ_CRASH();
if (!subPath.append(d_name, namlen))
MOZ_CRASH();
// Append same directory separator.
if (!subPath.append(path[pathlen - 1]))
MOZ_CRASH();
if (!subPath.append(0))
MOZ_CRASH();
- runTestFromPath<Tok>(cx, subPath.begin());
+ runTestFromPath<Tok>(cx, subPath.begin(), nullptr);
continue;
}
{
// Make sure that we run GC between two tests. Otherwise, since we're running
// everything from the same cx and without returning to JS, there is nothing
// to deallocate the ASTs.
JS::PrepareForFullGC(cx);
@@ -285,17 +289,22 @@ runTestFromPath<Tok>(JSContext* cx, cons
if (!FindClose(hFind))
MOZ_CRASH("Could not close Find");
#elif defined(XP_UNIX)
if (closedir(dir) != 0)
MOZ_CRASH("Could not close dir");
#endif // defined(XP_WIN)
}
-BEGIN_TEST(testBinASTReaderECMAScript2)
+BEGIN_TEST(testBinASTReaderTesterECMAScript2)
{
- runTestFromPath<BinTokenReaderTester>(cx, "jsapi-tests/binast/parser/tester/");
- runTestFromPath<BinTokenReaderMultipart>(cx, "jsapi-tests/binast/parser/multipart/");
-
+ runTestFromPath<js::frontend::BinTokenReaderTester>(cx, "jsapi-tests/binast/parser/tester/", "../jsapi-tests/binast/parser/tester/");
return true;
}
-END_TEST(testBinASTReaderECMAScript2)
+END_TEST(testBinASTReaderTesterECMAScript2)
+BEGIN_TEST(testBinASTReaderMultipartECMAScript2)
+{
+ runTestFromPath<js::frontend::BinTokenReaderMultipart>(cx, "jsapi-tests/binast/parser/multipart/", "../jsapi-tests/binast/parser/multipart/");
+ return true;
+}
+END_TEST(testBinASTReaderMultipartECMAScript2)
+
--- a/js/src/jsapi-tests/testBinTokenReaderTester.cpp
+++ b/js/src/jsapi-tests/testBinTokenReaderTester.cpp
@@ -113,16 +113,17 @@ void readFull(const char* path, js::Vect
int result = fread(buf.begin(), 1, info.st_size, in);
if (fclose(in) != 0)
MOZ_CRASH("Could not close input file");
if (result != info.st_size)
MOZ_CRASH_UNSAFE_PRINTF("Read error while reading %s: expected %llu bytes, got %llu", path, (unsigned long long)info.st_size, (unsigned long long)result);
exitJsDirectory();
}
+#if 0
// Reading a simple string.
BEGIN_TEST(testBinTokenReaderTesterSimpleString)
{
js::Vector<uint8_t> contents(cx);
readFull("jsapi-tests/binast/tokenizer/tester/test-simple-string.binjs", contents);
Tokenizer tokenizer(cx, contents);
@@ -310,8 +311,10 @@ BEGIN_TEST(testBinTokenReaderTesterNeste
}
CHECK(outerGuard.done());
}
return true;
}
END_TEST(testBinTokenReaderTesterNestedList)
+
+#endif // 0
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -679,17 +679,17 @@ if CONFIG['NIGHTLY_BUILD']:
# An experiment we want to run on Nightly and early Beta: Can we change the JS
# representation of an exported global from the global's value to an instance
# of WebAssembly.Global without breaking existing wasm content?
#
# Additionally guarded by EARLY_BETA_OR_EARLIER in the code.
DEFINES['ENABLE_WASM_GLOBAL'] = True
if CONFIG['JS_BUILD_BINAST']:
- # Using SOURCES as UNIFIED_SOURCES causes mysterious bugs on 32-bit platforms.
+ # Using SOURCES, as UNIFIED_SOURCES causes mysterious bugs on 32-bit platforms.
# These parts of BinAST are designed only to test evolutions of the
# specification.
SOURCES += ['frontend/BinTokenReaderTester.cpp']
# These parts of BinAST should eventually move to release.
SOURCES += [
'frontend/BinSource-auto.cpp',
'frontend/BinSource.cpp',
'frontend/BinToken.cpp',
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -4549,51 +4549,85 @@ GetModuleLoadPath(JSContext* cx, unsigne
static bool
BinParse(JSContext* cx, unsigned argc, Value* vp)
{
using namespace js::frontend;
CallArgs args = CallArgsFromVp(argc, vp);
- if (args.length() < 1) {
+ if (args.length() < 2) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
"parse", "0", "s");
return false;
}
+
+ // Extract argument 1: ArrayBuffer.
+
if (!args[0].isObject()) {
const char* typeName = InformalValueTypeName(args[0]);
JS_ReportErrorASCII(cx, "expected object (ArrayBuffer) to parse, got %s", typeName);
return false;
}
- RootedObject obj(cx, &args[0].toObject());
- if (!JS_IsArrayBufferObject(obj)) {
+ RootedObject objBuf(cx, &args[0].toObject());
+ if (!JS_IsArrayBufferObject(objBuf)) {
const char* typeName = InformalValueTypeName(args[0]);
JS_ReportErrorASCII(cx, "expected ArrayBuffer to parse, got %s", typeName);
return false;
}
uint32_t buf_length = 0;
bool buf_isSharedMemory = false;
uint8_t* buf_data = nullptr;
- GetArrayBufferViewLengthAndData(obj, &buf_length, &buf_isSharedMemory, &buf_data);
+ GetArrayBufferViewLengthAndData(objBuf, &buf_length, &buf_isSharedMemory, &buf_data);
MOZ_ASSERT(buf_data);
+ // Extract argument 2: Options.
+
+ if (!args[1].isObject()) {
+ const char* typeName = InformalValueTypeName(args[0]);
+ JS_ReportErrorASCII(cx, "expected object (options) to parse, got %s", typeName);
+ return false;
+ }
+ RootedObject objOptions(cx, &args[1].toObject());
+
+ bool useMultipart = true;
+ RootedValue optionFormat(cx);
+ if (!JS_GetProperty(cx, objOptions, "format", &optionFormat))
+ return false;
+
+ if (optionFormat.isUndefined()) {
+ useMultipart = true;
+ } else if (optionFormat.isString()) {
+ MOZ_CRASH("Not implemented");
+ } else {
+ const char* typeName = InformalValueTypeName(optionFormat);
+ JS_ReportErrorASCII(cx, "option `field` should be a string, got %s", typeName);
+ }
+
+
CompileOptions options(cx);
options.setIntroductionType("js shell bin parse")
.setFileAndLine("<ArrayBuffer>", 1);
UsedNameTracker usedNames(cx);
if (!usedNames.init())
return false;
- BinASTParser reader(cx, cx->tempLifoAlloc(), usedNames, options);
-
- JS::Result<ParseNode*> parsed = reader.parse(buf_data, buf_length);
+ JS::Result<ParseNode*> parsed(nullptr);
+ if (useMultipart) {
+ BinASTParser<BinTokenReaderMultipart> reader(cx, cx->tempLifoAlloc(), usedNames, options);
+
+ parsed = reader.parse(buf_data, buf_length);
+ } else {
+ BinASTParser<BinTokenReaderTester> reader(cx, cx->tempLifoAlloc(), usedNames, options);
+
+ parsed = reader.parse(buf_data, buf_length);
+ }
if (parsed.isErr())
return false;
#ifdef DEBUG
Fprinter out(stderr);
DumpParseTree(parsed.unwrap(), out);
#endif
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -1006,17 +1006,19 @@ struct JSRuntime : public js::MallocProv
// List of all the live wasm::Instances in the runtime. Equal to the union
// of all instances registered in all JSCompartments. Accessed from watchdog
// threads for purposes of wasm::InterruptRunningCode().
js::ExclusiveData<js::wasm::InstanceVector> wasmInstances;
public:
#if defined(JS_BUILD_BINAST)
- js::BinaryASTSupport& binast() const;
+ js::BinaryASTSupport& binast() {
+ return binast_;
+ }
private:
js::BinaryASTSupport binast_;
#endif // defined(JS_BUILD_BINAST)
public:
#if defined(NIGHTLY_BUILD)
// Support for informing the embedding of any error thrown.
// This mechanism is designed to let the embedding