Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: fixed openssl native add-ons
Browse files Browse the repository at this point in the history
- Added Value::IsArrayBufferView() needed for openssl native add-ons.
Implemented ArrayBufferView::HasBuffer() and ArrayBuffer::Cast().

- chakrashim: updated v8-version

- removed an unused method from chakrashim.

PR-URL: #96
Reviewed-By: Jianchun Xu <Jianchun.Xu@microsoft.com>
  • Loading branch information
kunalspathak committed Jul 13, 2016
1 parent 983c0b8 commit 784edee
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
6 changes: 3 additions & 3 deletions deps/chakrashim/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
// NOTE these macros are used by some of the tool scripts and the build
// system so their names cannot be changed without changing the scripts.
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 71
#define V8_PATCH_LEVEL 52
#define V8_MINOR_VERSION 1
#define V8_BUILD_NUMBER 281
#define V8_PATCH_LEVEL 69

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ class V8_EXPORT Value : public Data {
bool IsRegExp() const;
bool IsExternal() const;
bool IsArrayBuffer() const;
bool IsArrayBufferView() const;
bool IsTypedArray() const;
bool IsUint8Array() const;
bool IsUint8ClampedArray() const;
Expand Down
22 changes: 0 additions & 22 deletions deps/chakrashim/src/jsrtutils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -703,28 +703,6 @@ JsErrorCode DefineProperty(JsValueRef object,
return error;
}

JsErrorCode DefineProperty(JsValueRef object,
const wchar_t * propertyName,
PropertyDescriptorOptionValues writable,
PropertyDescriptorOptionValues enumerable,
PropertyDescriptorOptionValues configurable,
JsValueRef value,
JsValueRef getter,
JsValueRef setter) {
JsErrorCode error;
JsPropertyIdRef propertyIdRef;

error = JsGetPropertyIdFromName(propertyName, &propertyIdRef);
if (error != JsNoError) {
return error;
}

error = DefineProperty(
object, propertyIdRef, writable, enumerable, configurable, value,
getter, setter);
return error;
}

JsErrorCode GetPropertyIdFromName(JsValueRef nameRef,
JsPropertyIdRef *idRef) {
JsErrorCode error;
Expand Down
14 changes: 14 additions & 0 deletions deps/chakrashim/src/v8typedarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ size_t ArrayBufferView::ByteLength() {
return result;
}

bool ArrayBufferView::HasBuffer() const {
JsValueRef result;
if (JsGetTypedArrayInfo((JsValueRef)this,
nullptr, &result, nullptr, nullptr) != JsNoError) {
return false;
}
return result != nullptr;
}

ArrayBufferView* ArrayBufferView::Cast(Value* obj) {
CHAKRA_ASSERT(obj->IsArrayBufferView());
return static_cast<ArrayBufferView*>(obj);
}

size_t TypedArray::Length() {
JsValueRef typedArrayRef = (JsValueRef)this;
int result;
Expand Down
5 changes: 5 additions & 0 deletions deps/chakrashim/src/v8value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ DEFINE_TYPEDARRAY_CHECK(Int32)
DEFINE_TYPEDARRAY_CHECK(Float32)
DEFINE_TYPEDARRAY_CHECK(Float64)


bool Value::IsArrayBufferView() const {
return IsTypedArray() || IsDataView();
}

bool Value::IsDataView() const {
return IsOfType(this, JsValueType::JsDataView);
}
Expand Down

0 comments on commit 784edee

Please sign in to comment.