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

Side by Side Diff: src/runtime.cc

Issue 5995002: When setting property on a context extension object do not inherit the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 | « no previous file | test/mjsunit/with-readonly.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 7186 matching lines...) Expand 10 before | Expand all | Expand 10 after
7197 // The property was not found. It needs to be stored in the global context. 7197 // The property was not found. It needs to be stored in the global context.
7198 ASSERT(attributes == ABSENT); 7198 ASSERT(attributes == ABSENT);
7199 attributes = NONE; 7199 attributes = NONE;
7200 context_ext = Handle<JSObject>(Top::context()->global()); 7200 context_ext = Handle<JSObject>(Top::context()->global());
7201 } 7201 }
7202 7202
7203 // Set the property, but ignore if read_only variable on the context 7203 // Set the property, but ignore if read_only variable on the context
7204 // extension object itself. 7204 // extension object itself.
7205 if ((attributes & READ_ONLY) == 0 || 7205 if ((attributes & READ_ONLY) == 0 ||
7206 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { 7206 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) {
7207 Handle<Object> set = SetProperty(context_ext, name, value, attributes); 7207 Handle<Object> set = SetProperty(context_ext, name, value, NONE);
7208 if (set.is_null()) { 7208 if (set.is_null()) {
7209 // Failure::Exception is converted to a null handle in the 7209 // Failure::Exception is converted to a null handle in the
7210 // handle-based methods such as SetProperty. We therefore need 7210 // handle-based methods such as SetProperty. We therefore need
7211 // to convert null handles back to exceptions. 7211 // to convert null handles back to exceptions.
7212 ASSERT(Top::has_pending_exception()); 7212 ASSERT(Top::has_pending_exception());
7213 return Failure::Exception(); 7213 return Failure::Exception();
7214 } 7214 }
7215 } 7215 }
7216 return *value; 7216 return *value;
7217 } 7217 }
(...skipping 3578 matching lines...) Expand 10 before | Expand all | Expand 10 after
10796 } else { 10796 } else {
10797 // Handle last resort GC and make sure to allow future allocations 10797 // Handle last resort GC and make sure to allow future allocations
10798 // to grow the heap without causing GCs (if possible). 10798 // to grow the heap without causing GCs (if possible).
10799 Counters::gc_last_resort_from_js.Increment(); 10799 Counters::gc_last_resort_from_js.Increment();
10800 Heap::CollectAllGarbage(false); 10800 Heap::CollectAllGarbage(false);
10801 } 10801 }
10802 } 10802 }
10803 10803
10804 10804
10805 } } // namespace v8::internal 10805 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/with-readonly.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698