| 97 | } |
| 98 | |
| 99 | Variant GDScriptNativeClass::_new() { |
| 100 | Object *o = instantiate(); |
| 101 | ERR_FAIL_NULL_V_MSG(o, Variant(), "Class type: '" + String(name) + "' is not instantiable."); |
| 102 | |
| 103 | RefCounted *rc = Object::cast_to<RefCounted>(o); |
| 104 | if (rc) { |
| 105 | return Ref<RefCounted>(rc); |
| 106 | } else { |
| 107 | return o; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | Object *GDScriptNativeClass::instantiate() { |
| 112 | return ClassDB::instantiate_no_placeholders(name); |
no test coverage detected