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

Side by Side Diff: src/runtime.cc

Issue 6814012: Strict mode fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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
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 7802 matching lines...) Expand 10 before | Expand all | Expand 10 after
7813 } 7813 }
7814 7814
7815 // Slow case: The property is not in a FixedArray context. 7815 // Slow case: The property is not in a FixedArray context.
7816 // It is either in an JSObject extension context or it was not found. 7816 // It is either in an JSObject extension context or it was not found.
7817 Handle<JSObject> context_ext; 7817 Handle<JSObject> context_ext;
7818 7818
7819 if (!holder.is_null()) { 7819 if (!holder.is_null()) {
7820 // The property exists in the extension context. 7820 // The property exists in the extension context.
7821 context_ext = Handle<JSObject>::cast(holder); 7821 context_ext = Handle<JSObject>::cast(holder);
7822 } else { 7822 } else {
7823 // The property was not found. It needs to be stored in the global context. 7823 // The property was not found.
7824 ASSERT(attributes == ABSENT); 7824 ASSERT(attributes == ABSENT);
7825
Martin Maly 2011/04/07 10:07:07 Fourth fix. If eval is in scope, runtime call is u
7826 if (strict_mode == kStrictMode) {
7827 // Throw in strict mode (assignment to undefined variable).
7828 Handle<Object> error =
7829 isolate->factory()->NewReferenceError(
7830 "not_defined", HandleVector(&name, 1));
7831 return isolate->Throw(*error);
7832 }
7833 // In non-strict mode, the property is stored in the global context.
7825 attributes = NONE; 7834 attributes = NONE;
7826 context_ext = Handle<JSObject>(isolate->context()->global()); 7835 context_ext = Handle<JSObject>(isolate->context()->global());
7827 } 7836 }
7828 7837
7829 // Set the property, but ignore if read_only variable on the context 7838 // Set the property, but ignore if read_only variable on the context
7830 // extension object itself. 7839 // extension object itself.
7831 if ((attributes & READ_ONLY) == 0 || 7840 if ((attributes & READ_ONLY) == 0 ||
7832 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) { 7841 (context_ext->GetLocalPropertyAttribute(*name) == ABSENT)) {
7833 RETURN_IF_EMPTY_HANDLE( 7842 RETURN_IF_EMPTY_HANDLE(
7834 isolate, 7843 isolate,
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after
11943 } else { 11952 } else {
11944 // Handle last resort GC and make sure to allow future allocations 11953 // Handle last resort GC and make sure to allow future allocations
11945 // to grow the heap without causing GCs (if possible). 11954 // to grow the heap without causing GCs (if possible).
11946 isolate->counters()->gc_last_resort_from_js()->Increment(); 11955 isolate->counters()->gc_last_resort_from_js()->Increment();
11947 isolate->heap()->CollectAllGarbage(false); 11956 isolate->heap()->CollectAllGarbage(false);
11948 } 11957 }
11949 } 11958 }
11950 11959
11951 11960
11952 } } // namespace v8::internal 11961 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698