Revert "Fix typo"
This reverts commit r14506 (that was commited with a wrong description). git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
b029ad4201
commit
3af1cc1072
61
include/v8.h
61
include/v8.h
@ -1108,67 +1108,6 @@ class V8EXPORT Value : public Data {
|
||||
*/
|
||||
bool IsRegExp() const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if this value is an ArrayBuffer.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsArrayBuffer() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is one of TypedArrays.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsTypedArray() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Uint8Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsUint8Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Int8Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsInt8Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Uint16Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsUint16Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Int16Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsInt16Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Uint32Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsUint32Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is an Int32Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsInt32Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is a Float32Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsFloat32Array() const;
|
||||
|
||||
/**
|
||||
* Returns true if this value is a Float64Array.
|
||||
* This is an experimental feature.
|
||||
*/
|
||||
bool IsFloat64Array() const;
|
||||
|
||||
Local<Boolean> ToBoolean() const;
|
||||
Local<Number> ToNumber() const;
|
||||
Local<String> ToString() const;
|
||||
|
48
src/api.cc
48
src/api.cc
@ -2409,45 +2409,6 @@ bool Value::IsArray() const {
|
||||
}
|
||||
|
||||
|
||||
bool Value::IsArrayBuffer() const {
|
||||
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsArrayBuffer()"))
|
||||
return false;
|
||||
return Utils::OpenHandle(this)->IsJSArrayBuffer();
|
||||
}
|
||||
|
||||
|
||||
bool Value::IsTypedArray() const {
|
||||
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsArrayBuffer()"))
|
||||
return false;
|
||||
return Utils::OpenHandle(this)->IsJSTypedArray();
|
||||
}
|
||||
|
||||
|
||||
#define TYPED_ARRAY_LIST(F) \
|
||||
F(Uint8Array, kExternalUnsignedByteArray) \
|
||||
F(Int8Array, kExternalByteArray) \
|
||||
F(Uint16Array, kExternalUnsignedShortArray) \
|
||||
F(Int16Array, kExternalShortArray) \
|
||||
F(Uint32Array, kExternalUnsignedIntArray) \
|
||||
F(Int32Array, kExternalIntArray) \
|
||||
F(Float32Array, kExternalFloatArray) \
|
||||
F(Float64Array, kExternalDoubleArray)
|
||||
|
||||
|
||||
#define VALUE_IS_TYPED_ARRAY(TypedArray, type_const) \
|
||||
bool Value::Is##TypedArray() const { \
|
||||
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::Is" #TypedArray "()")) \
|
||||
return false; \
|
||||
i::Handle<i::Object> obj = Utils::OpenHandle(this); \
|
||||
if (!obj->IsJSTypedArray()) return false; \
|
||||
return i::JSTypedArray::cast(*obj)->type() == type_const; \
|
||||
}
|
||||
|
||||
TYPED_ARRAY_LIST(VALUE_IS_TYPED_ARRAY)
|
||||
|
||||
#undef VALUE_IS_TYPED_ARRAY
|
||||
|
||||
|
||||
bool Value::IsObject() const {
|
||||
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsObject()")) return false;
|
||||
return Utils::OpenHandle(this)->IsJSObject();
|
||||
@ -2815,7 +2776,14 @@ void v8::TypedArray::CheckCast(Value* that) {
|
||||
}
|
||||
|
||||
|
||||
TYPED_ARRAY_LIST(CHECK_TYPED_ARRAY_CAST)
|
||||
CHECK_TYPED_ARRAY_CAST(Uint8Array, kExternalUnsignedByteArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Int8Array, kExternalByteArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Uint16Array, kExternalUnsignedShortArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Int16Array, kExternalShortArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Uint32Array, kExternalUnsignedIntArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Int32Array, kExternalIntArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Float32Array, kExternalFloatArray)
|
||||
CHECK_TYPED_ARRAY_CAST(Float64Array, kExternalDoubleArray)
|
||||
|
||||
#undef CHECK_TYPED_ARRAY_CAST
|
||||
|
||||
|
@ -15174,31 +15174,6 @@ THREADED_TEST(Float64Array) {
|
||||
v8::kExternalDoubleArray, -500, 500);
|
||||
}
|
||||
|
||||
#define IS_TYPED_ARRAY_TEST(TypedArray) \
|
||||
THREADED_TEST(Is##TypedArray) { \
|
||||
i::FLAG_harmony_typed_arrays = true; \
|
||||
LocalContext env; \
|
||||
v8::Isolate* isolate = env->GetIsolate(); \
|
||||
v8::HandleScope handle_scope(isolate); \
|
||||
\
|
||||
Handle<Value> result = CompileRun( \
|
||||
"var ab = new ArrayBuffer(128);" \
|
||||
"new " #TypedArray "(ab)"); \
|
||||
CHECK(result->Is##TypedArray()); \
|
||||
}
|
||||
|
||||
IS_TYPED_ARRAY_TEST(Uint8Array)
|
||||
IS_TYPED_ARRAY_TEST(Int8Array)
|
||||
IS_TYPED_ARRAY_TEST(Uint16Array)
|
||||
IS_TYPED_ARRAY_TEST(Int16Array)
|
||||
IS_TYPED_ARRAY_TEST(Uint32Array)
|
||||
IS_TYPED_ARRAY_TEST(Int32Array)
|
||||
IS_TYPED_ARRAY_TEST(Float32Array)
|
||||
IS_TYPED_ARRAY_TEST(Float64Array)
|
||||
|
||||
#undef IS_TYPED_ARRAY_TEST
|
||||
|
||||
|
||||
|
||||
THREADED_TEST(ScriptContextDependence) {
|
||||
LocalContext c1;
|
||||
|
Loading…
Reference in New Issue
Block a user