Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: src/parser.cc

Issue 5985010: Fix compile-problem in (currently) unused stand-alone preparser function. (Closed)
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2977 matching lines...) Expand 10 before | Expand all | Expand 10 after
2988 *depth = depth_acc; 2988 *depth = depth_acc;
2989 } 2989 }
2990 2990
2991 2991
2992 ObjectLiteral::Property* Parser::ParseObjectLiteralGetSet(bool is_getter, 2992 ObjectLiteral::Property* Parser::ParseObjectLiteralGetSet(bool is_getter,
2993 bool* ok) { 2993 bool* ok) {
2994 // Special handling of getter and setter syntax: 2994 // Special handling of getter and setter syntax:
2995 // { ... , get foo() { ... }, ... , set foo(v) { ... v ... } , ... } 2995 // { ... , get foo() { ... }, ... , set foo(v) { ... v ... } , ... }
2996 // We have already read the "get" or "set" keyword. 2996 // We have already read the "get" or "set" keyword.
2997 Token::Value next = Next(); 2997 Token::Value next = Next();
2998 // TODO(820): Allow NUMBER and STRING as well (and handle array indices). 2998 // TODO(820): Allow NUMBER and STRING as well (and handle array indices).
fschneider 2011/01/04 12:01:38 This TODO does not apply anymore?
2999 if (next == Token::IDENTIFIER || Token::IsKeyword(next)) { 2999 bool is_keyword = Token::IsKeyword(next);
3000 Handle<String> name = GetSymbol(CHECK_OK); 3000 if (next == Token::IDENTIFIER || next == Token::NUMBER ||
3001 next == Token::STRING || is_keyword) {
3002 Handle<String> name;
3003 if (is_keyword) {
3004 name = Factory::LookupAsciiSymbol(Token::String(next));
3005 } else {
3006 name = GetSymbol(CHECK_OK);
3007 }
3001 FunctionLiteral* value = 3008 FunctionLiteral* value =
3002 ParseFunctionLiteral(name, 3009 ParseFunctionLiteral(name,
3003 RelocInfo::kNoPosition, 3010 RelocInfo::kNoPosition,
3004 DECLARATION, 3011 DECLARATION,
3005 CHECK_OK); 3012 CHECK_OK);
3006 ObjectLiteral::Property* property = 3013 ObjectLiteral::Property* property =
3007 new ObjectLiteral::Property(is_getter, value); 3014 new ObjectLiteral::Property(is_getter, value);
3008 return property; 3015 return property;
3009 } else { 3016 } else {
3010 ReportUnexpectedToken(next); 3017 ReportUnexpectedToken(next);
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
4698 Handle<String> source = Handle<String>(String::cast(script->source())); 4705 Handle<String> source = Handle<String>(String::cast(script->source()));
4699 result = parser.ParseProgram(source, info->is_global()); 4706 result = parser.ParseProgram(source, info->is_global());
4700 } 4707 }
4701 } 4708 }
4702 4709
4703 info->SetFunction(result); 4710 info->SetFunction(result);
4704 return (result != NULL); 4711 return (result != NULL);
4705 } 4712 }
4706 4713
4707 } } // namespace v8::internal 4714 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698