typed arrays: root JS objects in HandleScope with Local<>

pull/24503/head
Ben Noordhuis 2012-03-26 07:05:13 -07:00
parent 036d907df7
commit 9d1fde7519
1 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ class TypedArray {
length = obj->Get(v8::String::New("length"))->Uint32Value(); length = obj->Get(v8::String::New("length"))->Uint32Value();
// TODO(deanm): Handle integer overflow. // TODO(deanm): Handle integer overflow.
v8::Handle<v8::Value> argv[1] = { v8::Local<v8::Value> argv[1] = {
v8::Integer::NewFromUnsigned(length * TBytes)}; v8::Integer::NewFromUnsigned(length * TBytes)};
buffer = ArrayBuffer::GetTemplate()-> buffer = ArrayBuffer::GetTemplate()->
GetFunction()->NewInstance(1, argv); GetFunction()->NewInstance(1, argv);
@ -253,7 +253,7 @@ class TypedArray {
length = args[0]->Uint32Value(); length = args[0]->Uint32Value();
// TODO(deanm): Handle integer overflow. // TODO(deanm): Handle integer overflow.
v8::Handle<v8::Value> argv[1] = { v8::Local<v8::Value> argv[1] = {
v8::Integer::NewFromUnsigned(length * TBytes)}; v8::Integer::NewFromUnsigned(length * TBytes)};
buffer = ArrayBuffer::GetTemplate()-> buffer = ArrayBuffer::GetTemplate()->
@ -431,7 +431,7 @@ class TypedArray {
args.This()->Get(v8::String::New("byteOffset"))->Uint32Value(); args.This()->Get(v8::String::New("byteOffset"))->Uint32Value();
// Call through to the ArrayBuffer, byteOffset, length constructor. // Call through to the ArrayBuffer, byteOffset, length constructor.
v8::Handle<v8::Value> argv[] = { v8::Local<v8::Value> argv[] = {
args.This()->Get(v8::String::New("buffer")), args.This()->Get(v8::String::New("buffer")),
v8::Integer::New(byte_offset), v8::Integer::New(byte_offset),
v8::Integer::New(end - begin)}; v8::Integer::New(end - begin)};