diff options
author | Benjamin Chen <benjaminlchen@gmail.com> | 2018-09-18 01:28:41 -0400 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2018-11-02 10:18:58 -0400 |
commit | 65fe999ed77c958468ca55c24e9242e193b55f95 (patch) | |
tree | 8977248f6c807913f3e2fd6b941d9a2f710eefea /src | |
parent | 74ba48294b115364b92bbd5c87c8025cd109e303 (diff) | |
download | android-node-v8-65fe999ed77c958468ca55c24e9242e193b55f95.tar.gz android-node-v8-65fe999ed77c958468ca55c24e9242e193b55f95.tar.bz2 android-node-v8-65fe999ed77c958468ca55c24e9242e193b55f95.zip |
vm: allow `cachedData` to also be TypedArray|DataView
PR-URL: https://github.com/nodejs/node/pull/22921
Refs: https://github.com/nodejs/node/issues/1826
Refs: https://github.com/nodejs/node/pull/22921#issuecomment-422350213
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_contextify.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 3fbc616fda..79943f1ad6 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -33,6 +33,7 @@ namespace contextify { using v8::Array; using v8::ArrayBuffer; +using v8::ArrayBufferView; using v8::Boolean; using v8::Context; using v8::EscapableHandleScope; @@ -64,7 +65,6 @@ using v8::String; using v8::Symbol; using v8::TryCatch; using v8::Uint32; -using v8::Uint8Array; using v8::UnboundScript; using v8::Value; using v8::WeakCallbackInfo; @@ -629,7 +629,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { Local<Integer> line_offset; Local<Integer> column_offset; - Local<Uint8Array> cached_data_buf; + Local<ArrayBufferView> cached_data_buf; bool produce_cached_data = false; Local<Context> parsing_context = context; @@ -642,8 +642,8 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { CHECK(args[3]->IsNumber()); column_offset = args[3].As<Integer>(); if (!args[4]->IsUndefined()) { - CHECK(args[4]->IsUint8Array()); - cached_data_buf = args[4].As<Uint8Array>(); + CHECK(args[4]->IsArrayBufferView()); + cached_data_buf = args[4].As<ArrayBufferView>(); } CHECK(args[5]->IsBoolean()); produce_cached_data = args[5]->IsTrue(); @@ -994,10 +994,10 @@ void ContextifyContext::CompileFunction( Local<Integer> column_offset = args[3].As<Integer>(); // Argument 5: cached data (optional) - Local<Uint8Array> cached_data_buf; + Local<ArrayBufferView> cached_data_buf; if (!args[4]->IsUndefined()) { - CHECK(args[4]->IsUint8Array()); - cached_data_buf = args[4].As<Uint8Array>(); + CHECK(args[4]->IsArrayBufferView()); + cached_data_buf = args[4].As<ArrayBufferView>(); } // Argument 6: produce cache data |