Revision: 5482
Author: [email protected]
Date: Fri Sep 17 01:34:53 2010
Log: Make some runtime arguments checks be RUNTIME_ASSERT, not ASSERT.

Review URL: http://codereview.chromium.org/3411013
http://code.google.com/p/v8/source/detail?r=5482

Modified:
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/test/mjsunit/fuzz-natives.js

=======================================
--- /branches/bleeding_edge/src/runtime.cc      Thu Sep 16 14:40:42 2010
+++ /branches/bleeding_edge/src/runtime.cc      Fri Sep 17 01:34:53 2010
@@ -946,7 +946,7 @@
   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.
@@ -8944,19 +8944,20 @@
 }


-// 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());
-
-  // Update break point state
+  RUNTIME_ASSERT(args[0]->IsNumber());
+  CONVERT_BOOLEAN_CHECKED(enable, args[1]);
+
+  // 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();
 }
@@ -8967,7 +8968,7 @@
 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]));
=======================================
--- /branches/bleeding_edge/test/mjsunit/fuzz-natives.js Fri Aug 27 04:47:12 2010 +++ /branches/bleeding_edge/test/mjsunit/fuzz-natives.js Fri Sep 17 01:34:53 2010
@@ -129,7 +129,6 @@
   // which means that we have to propagate errors back.
   "SetFunctionBreakPoint": true,
   "SetScriptBreakPoint": true,
-  "ChangeBreakOnException": true,
   "PrepareStep": true,

   // Too slow.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to