OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 HandleScope scope(isolate); | 305 HandleScope scope(isolate); |
306 Handle<Object> receiver = args.receiver(); | 306 Handle<Object> receiver = args.receiver(); |
307 if (receiver->IsJSBoundFunction()) { | 307 if (receiver->IsJSBoundFunction()) { |
308 return *JSBoundFunction::ToString(Handle<JSBoundFunction>::cast(receiver)); | 308 return *JSBoundFunction::ToString(Handle<JSBoundFunction>::cast(receiver)); |
309 } else if (receiver->IsJSFunction()) { | 309 } else if (receiver->IsJSFunction()) { |
310 return *JSFunction::ToString(Handle<JSFunction>::cast(receiver)); | 310 return *JSFunction::ToString(Handle<JSFunction>::cast(receiver)); |
311 } | 311 } |
312 THROW_NEW_ERROR_RETURN_FAILURE( | 312 THROW_NEW_ERROR_RETURN_FAILURE( |
313 isolate, NewTypeError(MessageTemplate::kNotGeneric, | 313 isolate, NewTypeError(MessageTemplate::kNotGeneric, |
314 isolate->factory()->NewStringFromAsciiChecked( | 314 isolate->factory()->NewStringFromAsciiChecked( |
315 "Function.prototype.toString"), | 315 "Function.prototype.toString"))); |
316 isolate->factory()->Function_string())); | |
317 } | 316 } |
318 | 317 |
319 } // namespace internal | 318 } // namespace internal |
320 } // namespace v8 | 319 } // namespace v8 |
OLD | NEW |