| Index: runtime/vm/dart_api_impl.cc
|
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
|
| index ddc4591ec468d102924b7dc67f332e7a5ef73884..3e0a40c479edb15a2ecedd1bb007651c1e8edc3d 100644
|
| --- a/runtime/vm/dart_api_impl.cc
|
| +++ b/runtime/vm/dart_api_impl.cc
|
| @@ -3613,11 +3613,6 @@ DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
|
| CURRENT_FUNC);
|
| }
|
| Class& cls = Class::Handle(Z, type_obj.type_class());
|
| -#if defined(DEBUG)
|
| - if (!cls.is_allocated() && Dart::IsRunningPrecompiledCode()) {
|
| - return Api::NewError("Precompilation dropped '%s'", cls.ToCString());
|
| - }
|
| -#endif
|
| TypeArguments& type_arguments =
|
| TypeArguments::Handle(Z, type_obj.arguments());
|
|
|
| @@ -3677,6 +3672,11 @@ DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
|
| cls = type_obj.type_class();
|
| }
|
| if (constructor.IsGenerativeConstructor()) {
|
| +#if defined(DEBUG)
|
| + if (!cls.is_allocated() && Dart::IsRunningPrecompiledCode()) {
|
| + return Api::NewError("Precompilation dropped '%s'", cls.ToCString());
|
| + }
|
| +#endif
|
| // Create the new object.
|
| new_object = Instance::New(cls);
|
| }
|
|
|