OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 13283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13294 return isolate->factory()->NewStringFromAsciiChecked(kNativeCodeSource); | 13294 return isolate->factory()->NewStringFromAsciiChecked(kNativeCodeSource); |
13295 } | 13295 } |
13296 | 13296 |
13297 | 13297 |
13298 // static | 13298 // static |
13299 Handle<String> JSFunction::ToString(Handle<JSFunction> function) { | 13299 Handle<String> JSFunction::ToString(Handle<JSFunction> function) { |
13300 Isolate* const isolate = function->GetIsolate(); | 13300 Isolate* const isolate = function->GetIsolate(); |
13301 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate); | 13301 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate); |
13302 | 13302 |
13303 // Check if {function} should hide its source code. | 13303 // Check if {function} should hide its source code. |
13304 if (!shared_info->script()->IsScript() || | 13304 if (!shared_info->IsUserJavaScript()) { |
13305 Script::cast(shared_info->script())->hide_source()) { | |
13306 return NativeCodeFunctionSourceString(shared_info); | 13305 return NativeCodeFunctionSourceString(shared_info); |
13307 } | 13306 } |
13308 | 13307 |
13309 // Check if we should print {function} as a class. | 13308 // Check if we should print {function} as a class. |
13310 Handle<Object> class_start_position = JSReceiver::GetDataProperty( | 13309 Handle<Object> class_start_position = JSReceiver::GetDataProperty( |
13311 function, isolate->factory()->class_start_position_symbol()); | 13310 function, isolate->factory()->class_start_position_symbol()); |
13312 if (class_start_position->IsSmi()) { | 13311 if (class_start_position->IsSmi()) { |
13313 Handle<Object> class_end_position = JSReceiver::GetDataProperty( | 13312 Handle<Object> class_end_position = JSReceiver::GetDataProperty( |
13314 function, isolate->factory()->class_end_position_symbol()); | 13313 function, isolate->factory()->class_end_position_symbol()); |
13315 Handle<String> script_source( | 13314 Handle<String> script_source( |
(...skipping 7107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20423 // depend on this. | 20422 // depend on this. |
20424 return DICTIONARY_ELEMENTS; | 20423 return DICTIONARY_ELEMENTS; |
20425 } | 20424 } |
20426 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20425 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20427 return kind; | 20426 return kind; |
20428 } | 20427 } |
20429 } | 20428 } |
20430 | 20429 |
20431 } // namespace internal | 20430 } // namespace internal |
20432 } // namespace v8 | 20431 } // namespace v8 |
OLD | NEW |