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

Side by Side Diff: src/runtime.cc

Issue 6597045: Do not allow non-configurable global properties to be made configurable (fixe... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | « no previous file | test/mjsunit/regress/regress-1213.js » ('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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 } 1097 }
1098 1098
1099 // Safari does not allow the invocation of callback setters for 1099 // Safari does not allow the invocation of callback setters for
1100 // function declarations. To mimic this behavior, we do not allow 1100 // function declarations. To mimic this behavior, we do not allow
1101 // the invocation of setters for function values. This makes a 1101 // the invocation of setters for function values. This makes a
1102 // difference for global functions with the same names as event 1102 // difference for global functions with the same names as event
1103 // handlers such as "function onload() {}". Firefox does call the 1103 // handlers such as "function onload() {}". Firefox does call the
1104 // onload setter in those case and Safari does not. We follow 1104 // onload setter in those case and Safari does not. We follow
1105 // Safari for compatibility. 1105 // Safari for compatibility.
1106 if (value->IsJSFunction()) { 1106 if (value->IsJSFunction()) {
1107 // Do not change DONT_DELETE to false from true.
1108 if (lookup.IsProperty() &&
1109 (lookup.type() != INTERCEPTOR)) {
1110 attributes = static_cast<PropertyAttributes>(
1111 attributes | (lookup.GetAttributes() & DONT_DELETE));
1112 }
1107 RETURN_IF_EMPTY_HANDLE(SetLocalPropertyIgnoreAttributes(global, 1113 RETURN_IF_EMPTY_HANDLE(SetLocalPropertyIgnoreAttributes(global,
1108 name, 1114 name,
1109 value, 1115 value,
1110 attributes)); 1116 attributes));
1111 } else { 1117 } else {
1112 RETURN_IF_EMPTY_HANDLE(SetProperty(global, name, value, attributes)); 1118 RETURN_IF_EMPTY_HANDLE(SetProperty(global, name, value, attributes));
1113 } 1119 }
1114 } 1120 }
1115 1121
1116 ASSERT(!Top::has_pending_exception()); 1122 ASSERT(!Top::has_pending_exception());
(...skipping 10179 matching lines...) Expand 10 before | Expand all | Expand 10 after
11296 } else { 11302 } else {
11297 // Handle last resort GC and make sure to allow future allocations 11303 // Handle last resort GC and make sure to allow future allocations
11298 // to grow the heap without causing GCs (if possible). 11304 // to grow the heap without causing GCs (if possible).
11299 Counters::gc_last_resort_from_js.Increment(); 11305 Counters::gc_last_resort_from_js.Increment();
11300 Heap::CollectAllGarbage(false); 11306 Heap::CollectAllGarbage(false);
11301 } 11307 }
11302 } 11308 }
11303 11309
11304 11310
11305 } } // namespace v8::internal 11311 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1213.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698