Lines Matching refs:ThrowSyntaxError
303 ThrowSyntaxError({"Cannot open folder: ", resolvedPath}); in CollectDefaultSources()
428 … ThrowSyntaxError({"Can't find prefix for '", path, "' in ", ArkTSConfig()->ConfigPath()}); in ResolveImportPath()
450 ThrowSyntaxError("Incorrect path: " + resolvedPath); in GetSourceRegularPath()
468 ThrowSyntaxError({"Cannot open folder: ", resolvedPath}); in CollectUserSourcesFromIndex()
568 ThrowSyntaxError({"Failed to open file: ", resolvedPath.c_str()}); in ParseSources()
665 ThrowSyntaxError("Only one default export is allowed in a module", startPos); in MarkNodeAsExported()
694 …ThrowSyntaxError("Cannot find name '" + std::string {exportName.Utf8()} + "' to export.", startLoc… in ParseTopLevelStatements()
864 …ThrowSyntaxError({isAsync ? "'async'" : "'native'", " flags must be used for functions at top-leve… in ParseTokenOfNative()
1059 ThrowSyntaxError("Keyword must not contain escaped characters"); in ParseClassModifiers()
1081 ThrowSyntaxError("Duplicated modifier is not allowed"); in ParseClassModifiers()
1138 ThrowSyntaxError("Keyword must not contain escaped characters"); in ParseClassMemberAccessModifiers()
1196 ThrowSyntaxError("Keyword must not contain escaped characters"); in ParseClassFieldModifiers()
1215 ThrowSyntaxError("Duplicated modifier is not allowed"); in ParseClassFieldModifiers()
1258 ThrowSyntaxError("Keyword must not contain escaped characters"); in ParseClassMethodModifiers()
1296 ThrowSyntaxError("Duplicated modifier is not allowed"); in ParseClassMethodModifiers()
1302 ThrowSyntaxError("Native method cannot be async"); in ParseClassMethodModifiers()
1329 ThrowSyntaxError("Field type annotation expected"); in ParseClassFieldDefinition()
1342 ThrowSyntaxError("Initializers are not allowed in ambient contexts."); in ParseClassFieldDefinition()
1453 ThrowSyntaxError("'=>' expected"); in ParseFunction()
1526 ThrowSyntaxError("Type annotation isn't allowed for constructor."); in ParseFunctionReturnType()
1551 ThrowSyntaxError("Only 'throws' can be used with function types"); in ParseFunctionThrowMarker()
1563 ThrowSyntaxError("Label must be followed by a loop statement", Lexer()->GetToken().Start()); in ValidateLabeledStatement()
1571 …ThrowSyntaxError("Local type declaration (class, struct, interface and enum) support is not yet im… in ParseInnerTypeDeclaration()
1601 ThrowSyntaxError({"Namespaces should not have a constructor"}); in ParseInnerConstructorDeclaration()
1604 ThrowSyntaxError({"Constructor should not be async."}); in ParseInnerConstructorDeclaration()
1696 ThrowSyntaxError("Access modifier must precede field and method modifiers."); in ParseClassElement()
1816 ThrowSyntaxError("Namespaces are declare only"); in ParseTypeDeclaration()
1855 ThrowSyntaxError(errMsg.c_str()); in ParseTypeDeclaration()
1868 ThrowSyntaxError("Type alias is allowed only as top-level declaration"); in ParseTypeAliasDeclaration()
1875 ThrowSyntaxError("Identifier expected"); in ParseTypeAliasDeclaration()
1882 ThrowSyntaxError(errMsg.c_str()); in ParseTypeAliasDeclaration()
1902 ThrowSyntaxError("'=' expected"); in ParseTypeAliasDeclaration()
1940 ThrowSyntaxError( in ParseInterfaceBody()
1961 ThrowSyntaxError("Local interface declaration support is not yet implemented."); in ParseInterfaceDeclaration()
1981 ThrowSyntaxError("Local enum declaration support is not yet implemented."); in ParseEnumDeclaration()
2001 ThrowSyntaxError("Only call expressions are allowed after 'launch'", expr->Start()); in ParseLaunchExpression()
2093 ThrowSyntaxError("Duplicated modifier is not allowed"); in ParseInterfaceMethodModifiers()
2112 ThrowSyntaxError("Interface fields must have typeannotation."); in ParseInterfaceField()
2121 ThrowSyntaxError("Initializers are not allowed on interface propertys."); in ParseInterfaceField()
2158 … ThrowSyntaxError("Getter and setter methods must be abstracts in the interface body", startLoc); in ParseInterfaceMethod()
2162 ThrowSyntaxError("Private or static interface methods must have body", startLoc); in ParseInterfaceMethod()
2206 ThrowSyntaxError("Rest parameter should be the last one.", param->Start()); in CheckDefaultParameters()
2215 ThrowSyntaxError("Required parameter follows default parameter(s).", param->Start()); in CheckDefaultParameters()
2222 …ThrowSyntaxError("Both optional and rest parameters are not allowed in function's parameter list.", in CheckDefaultParameters()
2460 ThrowSyntaxError("Rest parameter must be the last formal parameter."); in ValidateRestParameter()
2624 ThrowSyntaxError("Primitive type is not allowed here."); in ParsePrimitiveType()
2792 ThrowSyntaxError("Only one spread type declaration allowed, at the last index"); in ParseETSTupleType()
2801 ThrowSyntaxError("Spread type must be at the last index in the tuple type"); in ParseETSTupleType()
2809 ThrowSyntaxError("Optional types in tuples are not yet implemented."); in ParseETSTupleType()
2814 ThrowSyntaxError("Spread type must be an array type"); in ParseETSTupleType()
2828 ThrowSyntaxError("Comma is mandatory between elements in a tuple type declaration"); in ParseETSTupleType()
2971 …ThrowSyntaxError("A 'this' type is available only as return type in a non-static method of a class… in ParseThisType()
2990 ThrowSyntaxError("Invalid Type"); in ParseTypeAnnotation()
3005 ThrowSyntaxError("Invalid intersection type."); in ParseTypeAnnotation()
3095 ThrowSyntaxError("Nested functions are not allowed"); in ParseFunctionStatement()
3140 ThrowSyntaxError("Unexpected token."); in ParseFromClause()
3147 ThrowSyntaxError("Unexpected token."); in ParseFromClause()
3258 … ThrowSyntaxError("The '*' token is not allowed as a selective binding (between braces)"); in ParseNamedSpecifiers()
3262 ThrowSyntaxError("Unexpected token"); in ParseNamedSpecifiers()
3312 ThrowSyntaxError("Unexpected token."); in ParseNameSpaceSpecifier()
3337 ThrowSyntaxError("Unexpected token, expected an identifier"); in ParseImportDefaultSpecifier()
3345 ThrowSyntaxError("Unexpected token, expected 'from'"); in ParseImportDefaultSpecifier()
3358 ThrowSyntaxError("Escape sequences are not allowed in 'as' keyword"); in CheckModuleAsModifier()
3385 ThrowSyntaxError("Unexpected token, expected an identifier."); in GetAnnotatedExpressionFromParam()
3397 ThrowSyntaxError("Unexpected token, expected an identifier."); in GetAnnotatedExpressionFromParam()
3419 ThrowSyntaxError(NO_DEFAULT_FOR_REST); in ParseFunctionParameter()
3434 ThrowSyntaxError(ONLY_ARRAY_FOR_REST); in ParseFunctionParameter()
3442 ThrowSyntaxError(EXPLICIT_PARAM_TYPE); in ParseFunctionParameter()
3447 ThrowSyntaxError(NO_DEFAULT_FOR_REST); in ParseFunctionParameter()
3454 ThrowSyntaxError("Not enable default value with default undefined"); in ParseFunctionParameter()
3459 ThrowSyntaxError("You didn't set the value."); in ParseFunctionParameter()
3554 ThrowSyntaxError("Variable must be initialized or it's type must be declared"); in ParseVariableDeclaratorKey()
3593 ThrowSyntaxError("Comma is mandatory between elements in an array literal"); in ParseArrayLiteral()
3608 ThrowSyntaxError("for-await-of loop variable declaration may not have an initializer"); in ParseVariableDeclaratorInitializer()
3632 ThrowSyntaxError("Missing initializer in const declaration"); in ParseVariableDeclarator()
3636 ThrowSyntaxError("Variable must be initialized or it's type must be declared"); in ParseVariableDeclarator()
3671 ThrowSyntaxError("Unexpected token, expected '('"); in ParseCatchParam()
3682 ThrowSyntaxError("Unexpected token in catch parameter, expected an identifier"); in ParseCatchParam()
3688 ThrowSyntaxError("Unexpected token, expected ')'"); in ParseCatchParam()
3706 ThrowSyntaxError("Catch clause variable cannot have an initializer"); in ParseCatchParamTypeAnnotation()
3716 ThrowSyntaxError("Unexpected token, expected '{'"); in ParseTryStatement()
3739 …ThrowSyntaxError("A try statement should contain either finally clause or at least one catch claus… in ParseTryStatement()
3841 ThrowSyntaxError("Invalid left-hand side in prefix operation"); in ParseUnaryOrPrefixUpdateExpression()
3892 … ThrowSyntaxError({"Unexpected token '", lexer::TokenToString(Lexer()->GetToken().Type()), "'."}); in ParseDefaultPrimaryExpression()
3947 ThrowSyntaxError("Type alias is allowed only as top-level declaration"); in ParsePrimaryExpression()
4040 ThrowSyntaxError("Unexpected token, expected ')'"); in ParseCoverParenthesizedExpressionAndArrowParameterList()
4075 ThrowSyntaxError("'(' expected"); in ParsePotentialGenericFunctionCall()
4192 ThrowSyntaxError("Invalid { after base types."); in ParseNewExpression()
4229 ThrowSyntaxError("Can not use 'new' on primitive types.", baseTypeReference->Start()); in ParseNewExpression()
4275 ThrowSyntaxError("Unexpected token. expected '('"); in ParseAsyncExpression()
4299 ThrowSyntaxError("Variance modifier is not allowed here."); in ParseTypeVarianceModifier()
4367 ThrowSyntaxError("'{' expected"); in ParseEnumMembers()
4373 ThrowSyntaxError("An enum must have at least one enum constant"); in ParseEnumMembers()
4441 ThrowSyntaxError(INVALID_ENUM_TYPE); in ParseNumberEnum()
4446 ThrowSyntaxError(INVALID_ENUM_VALUE); in ParseNumberEnum()
4474 ThrowSyntaxError(MISSING_COMMA_IN_ENUM); in ParseNumberEnum()
4500 ThrowSyntaxError(INVALID_ENUM_TYPE); in ParseStringEnum()
4506 … ThrowSyntaxError("All items of string-type enumeration should be explicitly initialized."); in ParseStringEnum()
4518 ThrowSyntaxError(MISSING_COMMA_IN_ENUM); in ParseStringEnum()
4524 ThrowSyntaxError(TRAILING_COMMA_IN_ENUM); in ParseStringEnum()
4574 ThrowSyntaxError("Illegal start of expression", Lexer()->GetToken().Start()); in ParseClassStatement()
4582 ThrowSyntaxError("Illegal start of expression", Lexer()->GetToken().Start()); in ParseStructStatement()
4591 ThrowSyntaxError("Only one static block is allowed", property->Start()); in CheckClassElement()
4622 ThrowSyntaxError(std::string {ir::INDEX_ACCESS_ERROR_1} + std::string {name.Utf8()} + in CheckIndexAccessMethod()
4634 ThrowSyntaxError(std::string {ir::INDEX_ACCESS_ERROR_1} + std::string {name.Utf8()} + in CheckIndexAccessMethod()
4640 ThrowSyntaxError(std::string {ir::INDEX_ACCESS_ERROR_1} + std::string {name.Utf8()} + in CheckIndexAccessMethod()
4654 ThrowSyntaxError(std::string {ir::INDEX_ACCESS_ERROR_1} + std::string {name.Utf8()} + in CheckIndexAccessMethod()
4727 ThrowSyntaxError("Invalid right-hand side in 'instanceof' expression"); in ValidateInstanceOfExpression()
4789 ThrowSyntaxError("A 'declare' modifier cannot be used in an already ambient context."); in CheckDeclare()
4809 ThrowSyntaxError("Unexpected token."); in CheckDeclare()
4837 ThrowSyntaxError(INVALID_NUMBER_NODE, Lexer()->GetToken().Start()); in GetFormatPlaceholderIdent()
4846 ThrowSyntaxError(INSERT_NODE_ABSENT, Lexer()->GetToken().Start()); in ParseFormatPlaceholder()
4859 ThrowSyntaxError(INVALID_FORMAT_NODE, Lexer()->GetToken().Start()); in ParseFormatPlaceholder()
4866 ThrowSyntaxError(INSERT_NODE_ABSENT, Lexer()->GetToken().Start()); in ParseExpressionFormatPlaceholder()
4874 ThrowSyntaxError(INVALID_FORMAT_NODE, Lexer()->GetToken().Start()); in ParseExpressionFormatPlaceholder()
4881 ThrowSyntaxError(INVALID_INSERT_NODE, Lexer()->GetToken().Start()); in ParseExpressionFormatPlaceholder()
4893 ThrowSyntaxError(INSERT_NODE_ABSENT, Lexer()->GetToken().Start()); in ParseTypeFormatPlaceholder()
4897 ThrowSyntaxError(INVALID_FORMAT_NODE, Lexer()->GetToken().Start()); in ParseTypeFormatPlaceholder()
4904 ThrowSyntaxError(INVALID_INSERT_NODE, Lexer()->GetToken().Start()); in ParseTypeFormatPlaceholder()
4917 ThrowSyntaxError(INSERT_NODE_ABSENT, Lexer()->GetToken().Start()); in ParseIdentifierFormatPlaceholder()
4921 ThrowSyntaxError(INVALID_FORMAT_NODE, Lexer()->GetToken().Start()); in ParseIdentifierFormatPlaceholder()
4928 ThrowSyntaxError(INVALID_INSERT_NODE, Lexer()->GetToken().Start()); in ParseIdentifierFormatPlaceholder()
4940 ThrowSyntaxError(INSERT_NODE_ABSENT, Lexer()->GetToken().Start()); in ParseStatementFormatPlaceholder()
4944 ThrowSyntaxError(INVALID_FORMAT_NODE, Lexer()->GetToken().Start()); in ParseStatementFormatPlaceholder()
4951 ThrowSyntaxError(INVALID_INSERT_NODE, Lexer()->GetToken().Start()); in ParseStatementFormatPlaceholder()
5057 ThrowSyntaxError({"Unexpected token. 'Constructor' keyword is expected."}); in CreateConstructorDefinition()
5061 ThrowSyntaxError({"Constructor should not be async."}); in CreateConstructorDefinition()