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

Side by Side Diff: src/messages.js

Issue 8688007: Statically check for assignments to const in harmony mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed second round of comments. Created 9 years 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/compiler.cc ('k') | src/parser.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 "invalid_array_length", ["Invalid array length"], 199 "invalid_array_length", ["Invalid array length"],
200 "stack_overflow", ["Maximum call stack size exceeded"], 200 "stack_overflow", ["Maximum call stack size exceeded"],
201 "invalid_time_value", ["Invalid time value"], 201 "invalid_time_value", ["Invalid time value"],
202 // SyntaxError 202 // SyntaxError
203 "unable_to_parse", ["Parse error"], 203 "unable_to_parse", ["Parse error"],
204 "invalid_regexp_flags", ["Invalid flags supplied to RegExp constru ctor '", "%0", "'"], 204 "invalid_regexp_flags", ["Invalid flags supplied to RegExp constru ctor '", "%0", "'"],
205 "invalid_regexp", ["Invalid RegExp pattern /", "%0", "/"], 205 "invalid_regexp", ["Invalid RegExp pattern /", "%0", "/"],
206 "illegal_break", ["Illegal break statement"], 206 "illegal_break", ["Illegal break statement"],
207 "illegal_continue", ["Illegal continue statement"], 207 "illegal_continue", ["Illegal continue statement"],
208 "illegal_return", ["Illegal return statement"], 208 "illegal_return", ["Illegal return statement"],
209 "illegal_let", ["Illegal let declaration outside extended mode"],
209 "error_loading_debugger", ["Error loading debugger"], 210 "error_loading_debugger", ["Error loading debugger"],
210 "no_input_to_regexp", ["No input to ", "%0"], 211 "no_input_to_regexp", ["No input to ", "%0"],
211 "invalid_json", ["String '", "%0", "' is not valid JSON"], 212 "invalid_json", ["String '", "%0", "' is not valid JSON"],
212 "circular_structure", ["Converting circular structure to JSON"], 213 "circular_structure", ["Converting circular structure to JSON"],
213 "obj_ctor_property_non_object", ["Object.", "%0", " called on non-object"] , 214 "obj_ctor_property_non_object", ["Object.", "%0", " called on non-object"] ,
214 "called_on_null_or_undefined", ["%0", " called on null or undefined"], 215 "called_on_null_or_undefined", ["%0", " called on null or undefined"],
215 "array_indexof_not_defined", ["Array.getIndexOf: Argument undefined"], 216 "array_indexof_not_defined", ["Array.getIndexOf: Argument undefined"],
216 "object_not_extensible", ["Can't add property ", "%0", ", object is not extensible"], 217 "object_not_extensible", ["Can't add property ", "%0", ", object is not extensible"],
217 "illegal_access", ["Illegal access"], 218 "illegal_access", ["Illegal access"],
218 "invalid_preparser_data", ["Invalid preparser data for function ", " %0"], 219 "invalid_preparser_data", ["Invalid preparser data for function ", " %0"],
(...skipping 19 matching lines...) Expand all
238 "strict_const", ["Use of const in strict mode."], 239 "strict_const", ["Use of const in strict mode."],
239 "strict_function", ["In strict mode code, functions can only be declared at top level or immediately within another function." ], 240 "strict_function", ["In strict mode code, functions can only be declared at top level or immediately within another function." ],
240 "strict_read_only_property", ["Cannot assign to read only property '", "%0", "' of ", "%1"], 241 "strict_read_only_property", ["Cannot assign to read only property '", "%0", "' of ", "%1"],
241 "strict_cannot_assign", ["Cannot assign to read only '", "%0", "' in strict mode"], 242 "strict_cannot_assign", ["Cannot assign to read only '", "%0", "' in strict mode"],
242 "strict_poison_pill", ["'caller', 'callee', and 'arguments' prop erties may not be accessed on strict mode functions or the arguments objects for calls to them"], 243 "strict_poison_pill", ["'caller', 'callee', and 'arguments' prop erties may not be accessed on strict mode functions or the arguments objects for calls to them"],
243 "strict_caller", ["Illegal access to a strict mode caller f unction."], 244 "strict_caller", ["Illegal access to a strict mode caller f unction."],
244 "unprotected_let", ["Illegal let declaration in unprotected s tatement context."], 245 "unprotected_let", ["Illegal let declaration in unprotected s tatement context."],
245 "unprotected_const", ["Illegal const declaration in unprotected statement context."], 246 "unprotected_const", ["Illegal const declaration in unprotected statement context."],
246 "cant_prevent_ext_external_array_elements", ["Cannot prevent extension of an object with external array elements"], 247 "cant_prevent_ext_external_array_elements", ["Cannot prevent extension of an object with external array elements"],
247 "redef_external_array_element", ["Cannot redefine a property of an object with external array elements"], 248 "redef_external_array_element", ["Cannot redefine a property of an object with external array elements"],
249 "harmony_const_assign", ["Assignment to constant variable."],
248 ]; 250 ];
249 var messages = { __proto__ : null }; 251 var messages = { __proto__ : null };
250 for (var i = 0; i < messagesDictionary.length; i += 2) { 252 for (var i = 0; i < messagesDictionary.length; i += 2) {
251 var key = messagesDictionary[i]; 253 var key = messagesDictionary[i];
252 var format = messagesDictionary[i + 1]; 254 var format = messagesDictionary[i + 1];
253 255
254 for (var j = 0; j < format.length; j++) { 256 for (var j = 0; j < format.length; j++) {
255 %IgnoreAttributesAndSetProperty(format, %_NumberToString(j), format[j], 257 %IgnoreAttributesAndSetProperty(format, %_NumberToString(j), format[j],
256 DONT_DELETE | READ_ONLY | DONT_ENUM); 258 DONT_DELETE | READ_ONLY | DONT_ENUM);
257 } 259 }
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 throw e; 1192 throw e;
1191 } 1193 }
1192 } 1194 }
1193 1195
1194 1196
1195 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]); 1197 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', ErrorToString]);
1196 1198
1197 // Boilerplate for exceptions for stack overflows. Used from 1199 // Boilerplate for exceptions for stack overflows. Used from
1198 // Isolate::StackOverflow(). 1200 // Isolate::StackOverflow().
1199 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); 1201 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []);
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698