| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index dcadf52a6a64dcb2a6022fbbe80a10fff2d3ad33..8b323b2f1fb7264f3b8da49cf1c491ec33c06742 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -541,9 +541,7 @@ Extension::Extension(const char* name,
|
| source_(source, source_length_),
|
| dep_count_(dep_count),
|
| deps_(deps),
|
| - auto_enable_(false) {
|
| - CHECK(source != NULL || source_length_ == 0);
|
| -}
|
| + auto_enable_(false) { }
|
|
|
|
|
| v8::Handle<Primitive> Undefined() {
|
| @@ -765,7 +763,7 @@ void Context::Exit() {
|
| }
|
|
|
|
|
| -void Context::SetData(v8::Handle<Value> data) {
|
| +void Context::SetData(v8::Handle<String> data) {
|
| i::Handle<i::Context> env = Utils::OpenHandle(this);
|
| i::Isolate* isolate = env->GetIsolate();
|
| if (IsDeadCheck(isolate, "v8::Context::SetData()")) return;
|
| @@ -781,13 +779,16 @@ v8::Local<v8::Value> Context::GetData() {
|
| i::Handle<i::Context> env = Utils::OpenHandle(this);
|
| i::Isolate* isolate = env->GetIsolate();
|
| if (IsDeadCheck(isolate, "v8::Context::GetData()")) {
|
| - return Local<Value>();
|
| + return v8::Local<Value>();
|
| }
|
| + i::Object* raw_result = NULL;
|
| ASSERT(env->IsNativeContext());
|
| - if (!env->IsNativeContext()) {
|
| + if (env->IsNativeContext()) {
|
| + raw_result = env->data();
|
| + } else {
|
| return Local<Value>();
|
| }
|
| - i::Handle<i::Object> result(env->data(), isolate);
|
| + i::Handle<i::Object> result(raw_result, isolate);
|
| return Utils::ToLocal(result);
|
| }
|
|
|
| @@ -3401,7 +3402,7 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
|
| ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return);
|
| ENTER_V8(isolate);
|
| i::HandleScope scope(isolate);
|
| - if (!ApiCheck(length >= 0 && length <= i::ExternalPixelArray::kMaxLength,
|
| + if (!ApiCheck(length <= i::ExternalPixelArray::kMaxLength,
|
| "v8::Object::SetIndexedPropertiesToPixelData()",
|
| "length exceeds max acceptable value")) {
|
| return;
|
| @@ -3457,7 +3458,7 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData(
|
| ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return);
|
| ENTER_V8(isolate);
|
| i::HandleScope scope(isolate);
|
| - if (!ApiCheck(length >= 0 && length <= i::ExternalArray::kMaxLength,
|
| + if (!ApiCheck(length <= i::ExternalArray::kMaxLength,
|
| "v8::Object::SetIndexedPropertiesToExternalArrayData()",
|
| "length exceeds max acceptable value")) {
|
| return;
|
| @@ -4086,29 +4087,6 @@ void v8::String::VerifyExternalStringResource(
|
| CHECK_EQ(expected, value);
|
| }
|
|
|
| -void v8::String::VerifyExternalStringResourceBase(
|
| - v8::String::ExternalStringResourceBase* value, Encoding encoding) const {
|
| - i::Handle<i::String> str = Utils::OpenHandle(this);
|
| - const v8::String::ExternalStringResourceBase* expected;
|
| - Encoding expectedEncoding;
|
| - if (i::StringShape(*str).IsExternalAscii()) {
|
| - const void* resource =
|
| - i::Handle<i::ExternalAsciiString>::cast(str)->resource();
|
| - expected = reinterpret_cast<const ExternalStringResourceBase*>(resource);
|
| - expectedEncoding = ASCII_ENCODING;
|
| - } else if (i::StringShape(*str).IsExternalTwoByte()) {
|
| - const void* resource =
|
| - i::Handle<i::ExternalTwoByteString>::cast(str)->resource();
|
| - expected = reinterpret_cast<const ExternalStringResourceBase*>(resource);
|
| - expectedEncoding = TWO_BYTE_ENCODING;
|
| - } else {
|
| - expected = NULL;
|
| - expectedEncoding = str->IsAsciiRepresentation() ? ASCII_ENCODING
|
| - : TWO_BYTE_ENCODING;
|
| - }
|
| - CHECK_EQ(expected, value);
|
| - CHECK_EQ(expectedEncoding, encoding);
|
| -}
|
|
|
| const v8::String::ExternalAsciiStringResource*
|
| v8::String::GetExternalAsciiStringResource() const {
|
| @@ -4599,22 +4577,6 @@ bool Context::IsCodeGenerationFromStringsAllowed() {
|
| }
|
|
|
|
|
| -void Context::SetErrorMessageForCodeGenerationFromStrings(
|
| - Handle<String> error) {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (IsDeadCheck(isolate,
|
| - "v8::Context::SetErrorMessageForCodeGenerationFromStrings()")) {
|
| - return;
|
| - }
|
| - ENTER_V8(isolate);
|
| - i::Object** ctx = reinterpret_cast<i::Object**>(this);
|
| - i::Handle<i::Context> context =
|
| - i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx));
|
| - i::Handle<i::Object> error_handle = Utils::OpenHandle(*error);
|
| - context->set_error_message_for_code_gen_from_strings(*error_handle);
|
| -}
|
| -
|
| -
|
| void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) {
|
| i::GlobalHandles::SetWrapperClassId(global_handle, class_id);
|
| }
|
|
|