v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test-parsing.cc File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "v8.h"
#include "cctest.h"
#include "compiler.h"
#include "execution.h"
#include "isolate.h"
#include "objects.h"
#include "parser.h"
#include "preparser.h"
#include "scanner-character-streams.h"
#include "token.h"
#include "utils.h"
Include dependency graph for test-parsing.cc:

Go to the source code of this file.

Data Structures

class  ScriptResource
 
struct  CompleteParserRecorderFriend
 
class  TestExternalResource
 

Namespaces

 v8
 
 v8::internal
 

Macros

#define KEYWORD(t, s, d)   { s, i::Token::t },
 
#define CHECK_EQU(v1, v2)   CHECK_EQ(static_cast<int>(v1), static_cast<int>(v2))
 

Enumerations

enum  ParserFlag {
  kAllowLazy, kAllowNativesSyntax, kAllowHarmonyScoping, kAllowModules,
  kAllowGenerators, kAllowForOf, kAllowHarmonyNumericLiterals
}
 
enum  ParserSyncTestResult { kSuccessOrError, kSuccess, kError }
 

Functions

 TEST (ScanKeywords)
 
 TEST (ScanHTMLEndComments)
 
 TEST (Preparsing)
 
 TEST (PreparseFunctionDataIsUsed)
 
 TEST (PreparseSymbolDataIsUsed)
 
 TEST (StandAlonePreParser)
 
 TEST (StandAlonePreParserNoNatives)
 
 TEST (PreparsingObjectLiterals)
 
 TEST (StoringNumbersInPreParseData)
 
 TEST (RegressChromium62639)
 
 TEST (Regress928)
 
 TEST (PreParseOverflow)
 
void TestCharacterStream (const char *ascii_source, unsigned length, unsigned start=0, unsigned end=0)
 
 TEST (CharacterStreams)
 
 TEST (Utf8CharacterStream)
 
void TestStreamScanner (i::Utf16CharacterStream *stream, i::Token::Value *expected_tokens, int skip_pos=0, int skip_to=0)
 
 TEST (StreamScanner)
 
void TestScanRegExp (const char *re_source, const char *expected)
 
 TEST (RegExpScanning)
 
 TEST (ScopePositions)
 
i::Handle< i::StringFormatMessage (i::ScriptDataImpl *data)
 
template<typename Traits >
void SetParserFlags (i::ParserBase< Traits > *parser, i::EnumSet< ParserFlag > flags)
 
void TestParserSyncWithFlags (i::Handle< i::String > source, i::EnumSet< ParserFlag > flags, ParserSyncTestResult result)
 
void TestParserSync (const char *source, const ParserFlag *flag_list, size_t flag_list_length, ParserSyncTestResult result=kSuccessOrError)
 
 TEST (ParserSync)
 
 TEST (PreparserStrictOctal)
 
void RunParserSyncTest (const char *context_data[][2], const char *statement_data[], ParserSyncTestResult result, const ParserFlag *flags=NULL, int flags_len=0)
 
 TEST (ErrorsEvalAndArguments)
 
 TEST (NoErrorsEvalAndArgumentsSloppy)
 
 TEST (NoErrorsEvalAndArgumentsStrict)
 
 TEST (ErrorsFutureStrictReservedWords)
 
 TEST (NoErrorsFutureStrictReservedWords)
 
 TEST (ErrorsReservedWords)
 
 TEST (NoErrorsYieldSloppy)
 
 TEST (ErrorsYieldSloppyGenerator)
 
 TEST (ErrorsYieldStrict)
 
 TEST (ErrorsYield)
 
 TEST (ErrorsNameOfStrictFunction)
 
 TEST (NoErrorsNameOfStrictFunction)
 
 TEST (ErrorsIllegalWordsAsLabelsSloppy)
 
 TEST (ErrorsIllegalWordsAsLabelsStrict)
 
 TEST (NoErrorsIllegalWordsAsLabels)
 
 TEST (ErrorsParenthesizedLabels)
 
 TEST (NoErrorsParenthesizedDirectivePrologue)
 
 TEST (ErrorsNotAnIdentifierName)
 
 TEST (NoErrorsIdentifierNames)
 
 TEST (DontRegressPreParserDataSizes)
 
 TEST (FunctionDeclaresItselfStrict)
 
 TEST (ErrorsTryWithoutCatchOrFinally)
 
 TEST (NoErrorsTryCatchFinally)
 
 TEST (ErrorsRegexpLiteral)
 
 TEST (NoErrorsRegexpLiteral)
 
 TEST (Intrinsics)
 
 TEST (NoErrorsNewExpression)
 
 TEST (ErrorsNewExpression)
 
 TEST (StrictObjectLiteralChecking)
 
 TEST (ErrorsObjectLiteralChecking)
 
 TEST (NoErrorsObjectLiteralChecking)
 
 TEST (TooManyArguments)
 
 TEST (StrictDelete)
 
 TEST (InvalidLeftHandSide)
 

Macro Definition Documentation

#define CHECK_EQU (   v1,
  v2 
)    CHECK_EQ(static_cast<int>(v1), static_cast<int>(v2))

Definition at line 638 of file test-parsing.cc.

Referenced by TEST(), and TestCharacterStream().

#define KEYWORD (   t,
  s,
 
)    { s, i::Token::t },

Referenced by TEST().

Enumeration Type Documentation

enum ParserFlag
Enumerator
kAllowLazy 
kAllowNativesSyntax 
kAllowHarmonyScoping 
kAllowModules 
kAllowGenerators 
kAllowForOf 
kAllowHarmonyNumericLiterals 

Definition at line 1295 of file test-parsing.cc.

Enumerator
kSuccessOrError 
kSuccess 
kError 

Definition at line 1306 of file test-parsing.cc.

Function Documentation

void RunParserSyncTest ( const char *  context_data[][2],
const char *  statement_data[],
ParserSyncTestResult  result,
const ParserFlag flags = NULL,
int  flags_len = 0 
)
TEST ( PreparsingObjectLiterals  )
TEST ( StoringNumbersInPreParseData  )
TEST ( CharacterStreams  )

Definition at line 752 of file test-parsing.cc.

References CcTest::isolate(), Context::New(), and TestCharacterStream().

TEST ( RegExpScanning  )

Definition at line 931 of file test-parsing.cc.

References V8::Initialize(), and TestScanRegExp().

TEST ( ErrorsEvalAndArguments  )

Definition at line 1627 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsEvalAndArgumentsSloppy  )

Definition at line 1666 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( NoErrorsEvalAndArgumentsStrict  )

Definition at line 1703 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsFutureStrictReservedWords  )

Definition at line 1726 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsFutureStrictReservedWords  )

Definition at line 1755 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsReservedWords  )

Definition at line 1780 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsYieldSloppy  )

Definition at line 1811 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsYieldSloppyGenerator  )

Definition at line 1838 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( ErrorsYieldStrict  )

Definition at line 1866 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( ErrorsYield  )

Definition at line 1892 of file test-parsing.cc.

References kSuccessOrError, NULL, and RunParserSyncTest().

TEST ( ErrorsNameOfStrictFunction  )

Definition at line 1911 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsNameOfStrictFunction  )

Definition at line 1935 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsIllegalWordsAsLabelsSloppy  )

Definition at line 1954 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( ErrorsIllegalWordsAsLabelsStrict  )

Definition at line 1971 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsIllegalWordsAsLabels  )

Definition at line 1990 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsParenthesizedLabels  )

Definition at line 2011 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsParenthesizedDirectivePrologue  )

Definition at line 2028 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsNotAnIdentifierName  )

Definition at line 2044 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsIdentifierNames  )

Definition at line 2065 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( FunctionDeclaresItselfStrict  )

Definition at line 2163 of file test-parsing.cc.

References kError, kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsTryWithoutCatchOrFinally  )

Definition at line 2200 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsTryCatchFinally  )

Definition at line 2219 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsRegexpLiteral  )

Definition at line 2236 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsRegexpLiteral  )

Definition at line 2251 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( Intrinsics  )

Definition at line 2268 of file test-parsing.cc.

References kSuccessOrError, NULL, and RunParserSyncTest().

TEST ( NoErrorsNewExpression  )

Definition at line 2285 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsNewExpression  )

Definition at line 2324 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( StrictObjectLiteralChecking  )

Definition at line 2343 of file test-parsing.cc.

References kError, kSuccess, NULL, and RunParserSyncTest().

TEST ( ErrorsObjectLiteralChecking  )

Definition at line 2370 of file test-parsing.cc.

References kError, NULL, and RunParserSyncTest().

TEST ( NoErrorsObjectLiteralChecking  )

Definition at line 2405 of file test-parsing.cc.

References kSuccess, NULL, and RunParserSyncTest().

TEST ( TooManyArguments  )

Definition at line 2451 of file test-parsing.cc.

References kAllowLazy, kError, NULL, and RunParserSyncTest().

TEST ( StrictDelete  )

Definition at line 2476 of file test-parsing.cc.

References kError, kSuccess, NULL, and RunParserSyncTest().

TEST ( InvalidLeftHandSide  )

Definition at line 2530 of file test-parsing.cc.

References kError, kSuccess, NULL, and RunParserSyncTest().

void TestParserSync ( const char *  source,
const ParserFlag flag_list,
size_t  flag_list_length,
ParserSyncTestResult  result = kSuccessOrError 
)
void TestScanRegExp ( const char *  re_source,
const char *  expected 
)
void TestStreamScanner ( i::Utf16CharacterStream stream,
i::Token::Value expected_tokens,
int  skip_pos = 0,
int  skip_to = 0 
)