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

Unified Diff: src/runtime.cc

Issue 6698015: Implement strict mode arguments caller/callee. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Kevin's feedback. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c7aa5e0c5c1e7c5d87d9f3f9d282f876876a6057..9ef347c2e0c7e83393499f76b77ea5deb524868a 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4372,7 +4372,15 @@ static MaybeObject* Runtime_GetArgumentsProperty(Arguments args) {
// Handle special arguments properties.
if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n);
- if (key->Equals(Heap::callee_symbol())) return frame->function();
+ if (key->Equals(Heap::callee_symbol())) {
+ Object* function = frame->function();
+ if (function->IsJSFunction() &&
+ JSFunction::cast(function)->shared()->strict_mode()) {
+ return Top::Throw(*Factory::NewTypeError("strict_arguments_callee",
+ HandleVector<Object>(NULL, 0)));
+ }
+ return function;
+ }
// Lookup in the initial Object.prototype object.
return Top::initial_object_prototype()->GetProperty(*key);
« no previous file with comments | « src/messages.js ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698