Handle<String> name(String::cast(args[1]));
PropertyAttributes mode =
static_cast<PropertyAttributes>(Smi::cast(args[2])->value());
- ASSERT(mode == READ_ONLY || mode == NONE);
+ RUNTIME_ASSERT(mode == READ_ONLY || mode == NONE);
Handle<Object> initial_value(args[3]);
// Declarations are always done in the function context.
}
-// Change the state of break on exceptions
-// args[0]: boolean indicating uncaught exceptions
-// args[1]: boolean indicating on/off
+// Change the state of break on exceptions.
+// args[0]: Enum value indicating whether to affect caught/uncaught exceptions.
+// args[1]: Boolean indicating on/off.
static Object* Runtime_ChangeBreakOnException(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 2);
- ASSERT(args[0]->IsNumber());
- ASSERT(args[1]->IsBoolean());
+ RUNTIME_ASSERT(args[0]->IsNumber());
+ CONVERT_BOOLEAN_CHECKED(enable, args[1]);
- // Update break point state
+ // If the number doesn't match an enum value, the ChangeBreakOnException
+ // function will default to affecting caught exceptions.
ExceptionBreakType type =
static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
- bool enable = args[1]->ToBoolean()->IsTrue();
+ // Update break point state.
Debug::ChangeBreakOnException(type, enable);
return Heap::undefined_value();
}
static Object* Runtime_IsBreakOnException(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 1);
- ASSERT(args[0]->IsNumber());
+ RUNTIME_ASSERT(args[0]->IsNumber());
ExceptionBreakType type =
static_cast<ExceptionBreakType>(NumberToUint32(args[0]));