From: lrn@chromium.org Date: Fri, 17 Sep 2010 08:34:53 +0000 (+0000) Subject: Make some runtime arguments checks be RUNTIME_ASSERT, not ASSERT. X-Git-Tag: upstream/4.7.83~21193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b8235b306d02c38ef3e747d96a2bc4de30c10cf;p=platform%2Fupstream%2Fv8.git Make some runtime arguments checks be RUNTIME_ASSERT, not ASSERT. Review URL: http://codereview.chromium.org/3411013 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5482 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/runtime.cc b/src/runtime.cc index a5a85ff..9e16bc4 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -946,7 +946,7 @@ static Object* Runtime_DeclareContextSlot(Arguments args) { Handle name(String::cast(args[1])); PropertyAttributes mode = static_cast(Smi::cast(args[2])->value()); - ASSERT(mode == READ_ONLY || mode == NONE); + RUNTIME_ASSERT(mode == READ_ONLY || mode == NONE); Handle initial_value(args[3]); // Declarations are always done in the function context. @@ -8944,19 +8944,20 @@ static Object* Runtime_ClearBreakPoint(Arguments args) { } -// 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(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_ChangeBreakOnException(Arguments args) { 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(NumberToUint32(args[0])); diff --git a/test/mjsunit/fuzz-natives.js b/test/mjsunit/fuzz-natives.js index 901c190..cf08d7a 100644 --- a/test/mjsunit/fuzz-natives.js +++ b/test/mjsunit/fuzz-natives.js @@ -129,7 +129,6 @@ var knownProblems = { // which means that we have to propagate errors back. "SetFunctionBreakPoint": true, "SetScriptBreakPoint": true, - "ChangeBreakOnException": true, "PrepareStep": true, // Too slow.