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

Unified Diff: src/runtime.cc

Issue 460070: Fix issue 540 by handling the case that a declaration is in the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-540.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 3419)
+++ src/runtime.cc (working copy)
@@ -719,12 +719,15 @@
if (*initial_value != NULL) {
if (index >= 0) {
// The variable or constant context slot should always be in
- // the function context; not in any outer context nor in the
- // arguments object.
- ASSERT(holder.is_identical_to(context));
- if (((attributes & READ_ONLY) == 0) ||
- context->get(index)->IsTheHole()) {
- context->set(index, *initial_value);
+ // the function context or the arguments object.
+ if (holder->IsContext()) {
+ ASSERT(holder.is_identical_to(context));
+ if (((attributes & READ_ONLY) == 0) ||
+ context->get(index)->IsTheHole()) {
+ context->set(index, *initial_value);
+ }
+ } else {
+ Handle<JSObject>::cast(holder)->SetElement(index, *initial_value);
}
} else {
// Slow case: The property is not in the FixedArray part of the context.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-540.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698