| Index: runtime/vm/code_generator.cc
|
| ===================================================================
|
| --- runtime/vm/code_generator.cc (revision 42146)
|
| +++ runtime/vm/code_generator.cc (working copy)
|
| @@ -54,7 +54,6 @@
|
| DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks.");
|
|
|
| DECLARE_FLAG(int, deoptimization_counter_threshold);
|
| -DECLARE_FLAG(bool, enable_asserts);
|
| DECLARE_FLAG(bool, enable_type_checks);
|
| DECLARE_FLAG(bool, warn_on_javascript_compatibility);
|
|
|
| @@ -560,29 +559,12 @@
|
|
|
|
|
| // Report that the type of the given object is not bool in conditional context.
|
| -// Throw assertion error if the object is null. (cf. Boolean Conversion
|
| -// in language Spec.)
|
| // Arg0: bad object.
|
| -// Return value: none, throws TypeError or AssertionError.
|
| +// Return value: none, throws a TypeError.
|
| DEFINE_RUNTIME_ENTRY(NonBoolTypeError, 1) {
|
| const intptr_t location = GetCallerLocation();
|
| const Instance& src_instance = Instance::CheckedHandle(arguments.ArgAt(0));
|
| -
|
| - if (src_instance.IsNull()) {
|
| - const Array& args = Array::Handle(Array::New(4));
|
| - args.SetAt(0, String::Handle(
|
| - String::New("Failed assertion: boolean expression must not be null")));
|
| -
|
| - // No source code for this assertion, set url to null.
|
| - args.SetAt(1, String::Handle(String::null()));
|
| - args.SetAt(2, Smi::Handle(Smi::New(0)));
|
| - args.SetAt(3, Smi::Handle(Smi::New(0)));
|
| -
|
| - Exceptions::ThrowByType(Exceptions::kAssertion, args);
|
| - UNREACHABLE();
|
| - }
|
| -
|
| - ASSERT(!src_instance.IsBool());
|
| + ASSERT(src_instance.IsNull() || !src_instance.IsBool());
|
| const Type& bool_interface = Type::Handle(Type::BoolType());
|
| const AbstractType& src_type = AbstractType::Handle(src_instance.GetType());
|
| const String& src_type_name = String::Handle(src_type.UserVisibleName());
|
|
|