| Index: src/runtime.cc
|
| ===================================================================
|
| --- src/runtime.cc (revision 7557)
|
| +++ src/runtime.cc (working copy)
|
| @@ -4380,7 +4380,15 @@
|
|
|
| // 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);
|
| @@ -8051,11 +8059,14 @@
|
| HandleScope scope;
|
| ASSERT(args.length() == 1);
|
| CONVERT_ARG_CHECKED(JSFunction, func, 0);
|
| - ASSERT(func->map()->instance_type() ==
|
| - Top::function_instance_map()->instance_type());
|
| - ASSERT(func->map()->instance_size() ==
|
| - Top::function_instance_map()->instance_size());
|
| - func->set_map(*Top::function_instance_map());
|
| +
|
| + Handle<Map> map = func->shared()->strict_mode()
|
| + ? Top::strict_mode_function_instance_map()
|
| + : Top::function_instance_map();
|
| +
|
| + ASSERT(func->map()->instance_type() == map->instance_type());
|
| + ASSERT(func->map()->instance_size() == map->instance_size());
|
| + func->set_map(*map);
|
| return *func;
|
| }
|
|
|
|
|