diff options
author | Jan Krems <jan.krems@groupon.com> | 2017-11-09 06:46:20 -0800 |
---|---|---|
committer | Jan Krems <jan.krems@groupon.com> | 2017-11-25 12:21:21 -0800 |
commit | 3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92 (patch) | |
tree | 4210be30683132d5d2834444fb4e00b16de82612 /deps/v8/src/api.h | |
parent | 29423b49c78f7880fa07f52447ce17c2c4aff5bc (diff) | |
download | node-new-3a4fe7791e1c2a1bcb7ac62ffbbcdefe41a45b92.tar.gz |
deps: cherry-pick dbfe4a49d8 from upstream V8
Original commit message:
Introduce ScriptOrModule and HostDefinedOptions
This patch introduces a new container type ScriptOrModule which
provides the name and the host defined options of the script/module.
This patch also introduces a new PrimitivesArray that can hold
Primitive values, which the embedder can use to store metadata.
The HostDefinedOptions is passed to V8 through the ScriptOrigin, and
passed back to the embedder through HostImportModuleDynamically for
module loading.
Bug: v8:5785, v8:6658, v8:6683
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I56c26fc9a680b273ac0a6691e5ad75f15b8dc80a
Reviewed-on: https://chromium-review.googlesource.com/622158
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47724}
PR-URL: https://github.com/nodejs/node/pull/16889
Refs: https://github.com/v8/v8/commit/dbfe4a49d88f6655ed31285a40b63786ab1e8e49
Refs: https://github.com/nodejs/node/pull/15713
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'deps/v8/src/api.h')
-rw-r--r-- | deps/v8/src/api.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/deps/v8/src/api.h b/deps/v8/src/api.h index e856a4408c..33ce26eec4 100644 --- a/deps/v8/src/api.h +++ b/deps/v8/src/api.h @@ -111,7 +111,10 @@ class RegisteredExtension { V(NativeWeakMap, JSWeakMap) \ V(debug::GeneratorObject, JSGeneratorObject) \ V(debug::Script, Script) \ - V(Promise, JSPromise) + V(Promise, JSPromise) \ + V(Primitive, Object) \ + V(PrimitiveArray, FixedArray) \ + V(ScriptOrModule, Script) class Utils { public: @@ -209,6 +212,12 @@ class Utils { v8::internal::Handle<v8::internal::JSWeakMap> obj); static inline Local<Function> CallableToLocal( v8::internal::Handle<v8::internal::JSReceiver> obj); + static inline Local<Primitive> ToLocalPrimitive( + v8::internal::Handle<v8::internal::Object> obj); + static inline Local<PrimitiveArray> ToLocal( + v8::internal::Handle<v8::internal::FixedArray> obj); + static inline Local<ScriptOrModule> ScriptOrModuleToLocal( + v8::internal::Handle<v8::internal::Script> obj); #define DECLARE_OPEN_HANDLE(From, To) \ static inline v8::internal::Handle<v8::internal::To> \ @@ -325,6 +334,9 @@ MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) MAKE_TO_LOCAL(ExternalToLocal, JSObject, External) MAKE_TO_LOCAL(NativeWeakMapToLocal, JSWeakMap, NativeWeakMap) MAKE_TO_LOCAL(CallableToLocal, JSReceiver, Function) +MAKE_TO_LOCAL(ToLocalPrimitive, Object, Primitive) +MAKE_TO_LOCAL(ToLocal, FixedArray, PrimitiveArray) +MAKE_TO_LOCAL(ScriptOrModuleToLocal, Script, ScriptOrModule) #undef MAKE_TO_LOCAL_TYPED_ARRAY #undef MAKE_TO_LOCAL |