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

Side by Side Diff: src/messages.js

Issue 12385082: Make sure builtin functions don't rely on __proto__. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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/math.js ('k') | src/mips/full-codegen-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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 %SetProperty($Error.prototype, 'message', '', DONT_ENUM); 1200 %SetProperty($Error.prototype, 'message', '', DONT_ENUM);
1201 1201
1202 // Global list of error objects visited during ErrorToString. This is 1202 // Global list of error objects visited during ErrorToString. This is
1203 // used to detect cycles in error toString formatting. 1203 // used to detect cycles in error toString formatting.
1204 var visited_errors = new InternalArray(); 1204 var visited_errors = new InternalArray();
1205 var cyclic_error_marker = new $Object(); 1205 var cyclic_error_marker = new $Object();
1206 1206
1207 function GetPropertyWithoutInvokingMonkeyGetters(error, name) { 1207 function GetPropertyWithoutInvokingMonkeyGetters(error, name) {
1208 // Climb the prototype chain until we find the holder. 1208 // Climb the prototype chain until we find the holder.
1209 while (error && !%HasLocalProperty(error, name)) { 1209 while (error && !%HasLocalProperty(error, name)) {
1210 error = error.__proto__; 1210 error = %GetPrototype(error);
1211 } 1211 }
1212 if (error === null) return void 0; 1212 if (error === null) return void 0;
1213 if (!IS_OBJECT(error)) return error[name]; 1213 if (!IS_OBJECT(error)) return error[name];
1214 // If the property is an accessor on one of the predefined errors that can be 1214 // If the property is an accessor on one of the predefined errors that can be
1215 // generated statically by the compiler, don't touch it. This is to address 1215 // generated statically by the compiler, don't touch it. This is to address
1216 // http://code.google.com/p/chromium/issues/detail?id=69187 1216 // http://code.google.com/p/chromium/issues/detail?id=69187
1217 var desc = %GetOwnProperty(error, name); 1217 var desc = %GetOwnProperty(error, name);
1218 if (desc && desc[IS_ACCESSOR_INDEX]) { 1218 if (desc && desc[IS_ACCESSOR_INDEX]) {
1219 var isName = name === "name"; 1219 var isName = name === "name";
1220 if (error === $ReferenceError.prototype) 1220 if (error === $ReferenceError.prototype)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 %SetOverflowedStackTrace(this, void 0); 1301 %SetOverflowedStackTrace(this, void 0);
1302 } 1302 }
1303 1303
1304 %DefineOrRedefineAccessorProperty( 1304 %DefineOrRedefineAccessorProperty(
1305 boilerplate, 'stack', getter, setter, DONT_ENUM); 1305 boilerplate, 'stack', getter, setter, DONT_ENUM);
1306 1306
1307 return boilerplate; 1307 return boilerplate;
1308 } 1308 }
1309 1309
1310 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); 1310 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate();
OLDNEW
« no previous file with comments | « src/math.js ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698