OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug.h" | 9 #include "src/debug.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 | 1065 |
1066 // If function should not have prototype, construction is not allowed. In this | 1066 // If function should not have prototype, construction is not allowed. In this |
1067 // case generated code bailouts here, since function has no initial_map. | 1067 // case generated code bailouts here, since function has no initial_map. |
1068 if (!function->should_have_prototype() && !function->shared()->bound()) { | 1068 if (!function->should_have_prototype() && !function->shared()->bound()) { |
1069 THROW_NEW_ERROR_RETURN_FAILURE( | 1069 THROW_NEW_ERROR_RETURN_FAILURE( |
1070 isolate, NewTypeError(MessageTemplate::kNotConstructor, constructor)); | 1070 isolate, NewTypeError(MessageTemplate::kNotConstructor, constructor)); |
1071 } | 1071 } |
1072 | 1072 |
1073 Debug* debug = isolate->debug(); | 1073 Debug* debug = isolate->debug(); |
1074 // Handle stepping into constructors if step into is active. | 1074 // Handle stepping into constructors if step into is active. |
1075 if (debug->StepInActive()) { | 1075 if (debug->StepInActive()) debug->HandleStepIn(function, true); |
1076 debug->HandleStepIn(function, Handle<Object>::null(), 0, true); | |
1077 } | |
1078 | 1076 |
1079 if (function->has_initial_map()) { | 1077 if (function->has_initial_map()) { |
1080 if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) { | 1078 if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) { |
1081 // The 'Function' function ignores the receiver object when | 1079 // The 'Function' function ignores the receiver object when |
1082 // called using 'new' and creates a new JSFunction object that | 1080 // called using 'new' and creates a new JSFunction object that |
1083 // is returned. The receiver object is only used for error | 1081 // is returned. The receiver object is only used for error |
1084 // reporting if an error occurs when constructing the new | 1082 // reporting if an error occurs when constructing the new |
1085 // JSFunction. Factory::NewJSObject() should not be used to | 1083 // JSFunction. Factory::NewJSObject() should not be used to |
1086 // allocate JSFunctions since it does not properly initialize | 1084 // allocate JSFunctions since it does not properly initialize |
1087 // the shared part of the function. Since the receiver is | 1085 // the shared part of the function. Since the receiver is |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1430 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
1433 | 1431 |
1434 RETURN_FAILURE_ON_EXCEPTION( | 1432 RETURN_FAILURE_ON_EXCEPTION( |
1435 isolate, | 1433 isolate, |
1436 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1434 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
1437 setter, attrs)); | 1435 setter, attrs)); |
1438 return isolate->heap()->undefined_value(); | 1436 return isolate->heap()->undefined_value(); |
1439 } | 1437 } |
1440 } // namespace internal | 1438 } // namespace internal |
1441 } // namespace v8 | 1439 } // namespace v8 |
OLD | NEW |