Commit a5ead4a4 authored by feng@chromium.org's avatar feng@chromium.org

Addressing Ivan's comments of using INVALID_TYPE in Factory::CreateApiFunction.

Review URL: http://codereview.chromium.org/7925

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 69686b14
...@@ -685,7 +685,7 @@ Handle<JSFunction> Factory::CreateApiFunction( ...@@ -685,7 +685,7 @@ Handle<JSFunction> Factory::CreateApiFunction(
} }
int instance_size = kPointerSize * internal_field_count; int instance_size = kPointerSize * internal_field_count;
InstanceType type = JS_OBJECT_TYPE; // initialize to a valid value InstanceType type = INVALID_TYPE;
switch (instance_type) { switch (instance_type) {
case JavaScriptObject: case JavaScriptObject:
type = JS_OBJECT_TYPE; type = JS_OBJECT_TYPE;
...@@ -700,9 +700,9 @@ Handle<JSFunction> Factory::CreateApiFunction( ...@@ -700,9 +700,9 @@ Handle<JSFunction> Factory::CreateApiFunction(
instance_size += JSGlobalProxy::kSize; instance_size += JSGlobalProxy::kSize;
break; break;
default: default:
ASSERT(false);
break; break;
} }
ASSERT(type != INVALID_TYPE);
Handle<JSFunction> result = Handle<JSFunction> result =
Factory::NewFunction(Factory::empty_symbol(), type, instance_size, Factory::NewFunction(Factory::empty_symbol(), type, instance_size,
......
...@@ -535,6 +535,7 @@ enum InstanceType { ...@@ -535,6 +535,7 @@ enum InstanceType {
// Pseudo-types // Pseudo-types
FIRST_NONSTRING_TYPE = MAP_TYPE, FIRST_NONSTRING_TYPE = MAP_TYPE,
FIRST_TYPE = 0x0, FIRST_TYPE = 0x0,
INVALID_TYPE = FIRST_TYPE - 1,
LAST_TYPE = JS_FUNCTION_TYPE, LAST_TYPE = JS_FUNCTION_TYPE,
// Boundaries for testing the type is a JavaScript "object". Note that // Boundaries for testing the type is a JavaScript "object". Note that
// function objects are not counted as objects, even though they are // function objects are not counted as objects, even though they are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment