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

Side by Side Diff: src/messages.js

Issue 11028027: Revert trunk to bleeding_edge at r12484 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/mark-compact-inl.h ('k') | src/mips/code-stubs-mips.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 throw new $Error("Not supported"); 133 throw new $Error("Not supported");
134 }); 134 });
135 135
136 136
137 // Helper functions; called from the runtime system. 137 // Helper functions; called from the runtime system.
138 function FormatMessage(message) { 138 function FormatMessage(message) {
139 if (kMessages === 0) { 139 if (kMessages === 0) {
140 var messagesDictionary = [ 140 var messagesDictionary = [
141 // Error 141 // Error
142 "cyclic_proto", ["Cyclic __proto__ value"], 142 "cyclic_proto", ["Cyclic __proto__ value"],
143 "code_gen_from_strings", ["%0"], 143 "code_gen_from_strings", ["Code generation from strings disallowed for this context"],
144 // TypeError 144 // TypeError
145 "unexpected_token", ["Unexpected token ", "%0"], 145 "unexpected_token", ["Unexpected token ", "%0"],
146 "unexpected_token_number", ["Unexpected number"], 146 "unexpected_token_number", ["Unexpected number"],
147 "unexpected_token_string", ["Unexpected string"], 147 "unexpected_token_string", ["Unexpected string"],
148 "unexpected_token_identifier", ["Unexpected identifier"], 148 "unexpected_token_identifier", ["Unexpected identifier"],
149 "unexpected_reserved", ["Unexpected reserved word"], 149 "unexpected_reserved", ["Unexpected reserved word"],
150 "unexpected_strict_reserved", ["Unexpected strict mode reserved word"], 150 "unexpected_strict_reserved", ["Unexpected strict mode reserved word"],
151 "unexpected_eos", ["Unexpected end of input"], 151 "unexpected_eos", ["Unexpected end of input"],
152 "malformed_regexp", ["Invalid regular expression: /", "%0", "/ : ", "%1"], 152 "malformed_regexp", ["Invalid regular expression: /", "%0", "/ : ", "%1"],
153 "unterminated_regexp", ["Invalid regular expression: missing /"], 153 "unterminated_regexp", ["Invalid regular expression: missing /"],
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 "called_on_non_object", ["%0", " called on non-object"], 222 "called_on_non_object", ["%0", " called on non-object"],
223 "called_on_null_or_undefined", ["%0", " called on null or undefined"], 223 "called_on_null_or_undefined", ["%0", " called on null or undefined"],
224 "array_indexof_not_defined", ["Array.getIndexOf: Argument undefined"], 224 "array_indexof_not_defined", ["Array.getIndexOf: Argument undefined"],
225 "object_not_extensible", ["Can't add property ", "%0", ", object is not extensible"], 225 "object_not_extensible", ["Can't add property ", "%0", ", object is not extensible"],
226 "illegal_access", ["Illegal access"], 226 "illegal_access", ["Illegal access"],
227 "invalid_preparser_data", ["Invalid preparser data for function ", " %0"], 227 "invalid_preparser_data", ["Invalid preparser data for function ", " %0"],
228 "strict_mode_with", ["Strict mode code may not include a with statement"], 228 "strict_mode_with", ["Strict mode code may not include a with statement"],
229 "strict_catch_variable", ["Catch variable may not be eval or argume nts in strict mode"], 229 "strict_catch_variable", ["Catch variable may not be eval or argume nts in strict mode"],
230 "too_many_arguments", ["Too many arguments in function call (onl y 32766 allowed)"], 230 "too_many_arguments", ["Too many arguments in function call (onl y 32766 allowed)"],
231 "too_many_parameters", ["Too many parameters in function definiti on (only 32766 allowed)"], 231 "too_many_parameters", ["Too many parameters in function definiti on (only 32766 allowed)"],
232 "too_many_variables", ["Too many variables declared (only 65535 allowed)"], 232 "too_many_variables", ["Too many variables declared (only 32767 allowed)"],
233 "strict_param_name", ["Parameter name eval or arguments is not allowed in strict mode"], 233 "strict_param_name", ["Parameter name eval or arguments is not allowed in strict mode"],
234 "strict_param_dupe", ["Strict mode function may not have duplic ate parameter names"], 234 "strict_param_dupe", ["Strict mode function may not have duplic ate parameter names"],
235 "strict_var_name", ["Variable name may not be eval or argumen ts in strict mode"], 235 "strict_var_name", ["Variable name may not be eval or argumen ts in strict mode"],
236 "strict_function_name", ["Function name may not be eval or argumen ts in strict mode"], 236 "strict_function_name", ["Function name may not be eval or argumen ts in strict mode"],
237 "strict_octal_literal", ["Octal literals are not allowed in strict mode."], 237 "strict_octal_literal", ["Octal literals are not allowed in strict mode."],
238 "strict_duplicate_property", ["Duplicate data property in object litera l not allowed in strict mode"], 238 "strict_duplicate_property", ["Duplicate data property in object litera l not allowed in strict mode"],
239 "accessor_data_property", ["Object literal may not have data and acc essor property with the same name"], 239 "accessor_data_property", ["Object literal may not have data and acc essor property with the same name"],
240 "accessor_get_set", ["Object literal may not have multiple get /set accessors with the same name"], 240 "accessor_get_set", ["Object literal may not have multiple get /set accessors with the same name"],
241 "strict_lhs_assignment", ["Assignment to eval or arguments is not a llowed in strict mode"], 241 "strict_lhs_assignment", ["Assignment to eval or arguments is not a llowed in strict mode"],
242 "strict_lhs_postfix", ["Postfix increment/decrement may not have eval or arguments operand in strict mode"], 242 "strict_lhs_postfix", ["Postfix increment/decrement may not have eval or arguments operand in strict mode"],
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 * @return {number} 525 * @return {number}
526 * Number of source lines. 526 * Number of source lines.
527 */ 527 */
528 function ScriptLineCount() { 528 function ScriptLineCount() {
529 // Return number of source lines. 529 // Return number of source lines.
530 return this.line_ends.length; 530 return this.line_ends.length;
531 } 531 }
532 532
533 533
534 /** 534 /**
535 * If sourceURL comment is available and script starts at zero returns sourceURL 535 * Returns the name of script if available, contents of sourceURL comment
536 * comment contents. Otherwise, script name is returned. See 536 * otherwise. See
537 * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt 537 * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
538 * for details on using //@ sourceURL comment to identify scritps that don't 538 * for details on using //@ sourceURL comment to identify scritps that don't
539 * have name. 539 * have name.
540 * 540 *
541 * @return {?string} script name if present, value for //@ sourceURL comment 541 * @return {?string} script name if present, value for //@ sourceURL comment
542 * otherwise. 542 * otherwise.
543 */ 543 */
544 function ScriptNameOrSourceURL() { 544 function ScriptNameOrSourceURL() {
545 if (this.line_offset > 0 || this.column_offset > 0) { 545 if (this.name) {
546 return this.name; 546 return this.name;
547 } 547 }
548 548
549 // The result is cached as on long scripts it takes noticable time to search 549 // The result is cached as on long scripts it takes noticable time to search
550 // for the sourceURL. 550 // for the sourceURL.
551 if (this.hasCachedNameOrSourceURL) { 551 if (this.hasCachedNameOrSourceURL)
552 return this.cachedNameOrSourceURL; 552 return this.cachedNameOrSourceURL;
553 }
554 this.hasCachedNameOrSourceURL = true; 553 this.hasCachedNameOrSourceURL = true;
555 554
556 // TODO(608): the spaces in a regexp below had to be escaped as \040 555 // TODO(608): the spaces in a regexp below had to be escaped as \040
557 // because this file is being processed by js2c whose handling of spaces 556 // because this file is being processed by js2c whose handling of spaces
558 // in regexps is broken. Also, ['"] are excluded from allowed URLs to 557 // in regexps is broken. Also, ['"] are excluded from allowed URLs to
559 // avoid matches against sources that invoke evals with sourceURL. 558 // avoid matches against sources that invoke evals with sourceURL.
560 // A better solution would be to detect these special comments in 559 // A better solution would be to detect these special comments in
561 // the scanner/parser. 560 // the scanner/parser.
562 var source = ToString(this.source); 561 var source = ToString(this.source);
563 var sourceUrlPos = %StringIndexOf(source, "sourceURL=", 0); 562 var sourceUrlPos = %StringIndexOf(source, "sourceURL=", 0);
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 throw e; 1260 throw e;
1262 } 1261 }
1263 } 1262 }
1264 1263
1265 1264
1266 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); 1265 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]);
1267 1266
1268 // Boilerplate for exceptions for stack overflows. Used from 1267 // Boilerplate for exceptions for stack overflows. Used from
1269 // Isolate::StackOverflow(). 1268 // Isolate::StackOverflow().
1270 var kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); 1269 var kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []);
OLDNEW
« no previous file with comments | « src/mark-compact-inl.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698