| 393 | } |
| 394 | |
| 395 | void GDScriptLanguage::debug_get_globals(List<String> *p_globals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { |
| 396 | const HashMap<StringName, int> &name_idx = GDScriptLanguage::get_singleton()->get_global_map(); |
| 397 | const Variant *gl_array = GDScriptLanguage::get_singleton()->get_global_array(); |
| 398 | |
| 399 | List<Pair<String, Variant>> cinfo; |
| 400 | get_public_constants(&cinfo); |
| 401 | |
| 402 | for (const KeyValue<StringName, int> &E : name_idx) { |
| 403 | if (ClassDB::class_exists(E.key) || Engine::get_singleton()->has_singleton(E.key)) { |
| 404 | continue; |
| 405 | } |
| 406 | |
| 407 | bool is_script_constant = false; |
| 408 | for (List<Pair<String, Variant>>::Element *CE = cinfo.front(); CE; CE = CE->next()) { |
| 409 | if (CE->get().first == E.key) { |
| 410 | is_script_constant = true; |
| 411 | break; |
| 412 | } |
| 413 | } |
| 414 | if (is_script_constant) { |
| 415 | continue; |
| 416 | } |
| 417 | |
| 418 | const Variant &var = gl_array[E.value]; |
| 419 | bool freed = false; |
| 420 | const Object *obj = var.get_validated_object_with_check(freed); |
| 421 | if (obj && !freed) { |
| 422 | if (Object::cast_to<GDScriptNativeClass>(obj)) { |
| 423 | continue; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | bool skip = false; |
| 428 | for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) { |
| 429 | if (E.key == CoreConstants::get_global_constant_name(i)) { |
| 430 | skip = true; |
| 431 | break; |
| 432 | } |
| 433 | } |
| 434 | if (skip) { |
| 435 | continue; |
| 436 | } |
| 437 | |
| 438 | p_globals->push_back(E.key); |
| 439 | p_values->push_back(var); |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | String GDScriptLanguage::debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) { |
| 444 | List<String> names; |
nothing calls this directly
no test coverage detected