Skip to content

Commit a27852a

Browse files
addaleaxBethGriggs
authored andcommitted
deps: V8: cherry-pick 98b1ef80c722
Original commit message: Expose the %ObjProto_valueOf% intrinsic object to embedders https://html.spec.whatwg.org/multipage/history.html#the-location-interface HTML Location platform objects need to be initialized with using the %ObjProto_valueOf% intrinsic object. This patch exposes the %ObjProto_valueOf% intrinsic object to embedders. Example usage is: https://crrev.com/c/2102306 Change-Id: Iec58135773e01aed5de330c0c5dea89a49835a52 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2102408 Reviewed-by: Yang Guo <[email protected]> Reviewed-by: Ulan Degenbaev <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#66747} Refs: v8/v8@98b1ef8 PR-URL: #32885 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
1 parent e8c7b7a commit a27852a

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Reset this number to 0 on major V8 upgrades.
3737
# Increment by one for each non-official patch applied to deps/v8.
38-
'v8_embedder_string': '-node.25',
38+
'v8_embedder_string': '-node.26',
3939

4040
##### V8 defaults for Node.js #####
4141

deps/v8/include/v8.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5926,13 +5926,14 @@ class V8_EXPORT External : public Value {
59265926
static void CheckCast(v8::Value* obj);
59275927
};
59285928

5929-
#define V8_INTRINSICS_LIST(F) \
5930-
F(ArrayProto_entries, array_entries_iterator) \
5931-
F(ArrayProto_forEach, array_for_each_iterator) \
5932-
F(ArrayProto_keys, array_keys_iterator) \
5933-
F(ArrayProto_values, array_values_iterator) \
5934-
F(ErrorPrototype, initial_error_prototype) \
5935-
F(IteratorPrototype, initial_iterator_prototype)
5929+
#define V8_INTRINSICS_LIST(F) \
5930+
F(ArrayProto_entries, array_entries_iterator) \
5931+
F(ArrayProto_forEach, array_for_each_iterator) \
5932+
F(ArrayProto_keys, array_keys_iterator) \
5933+
F(ArrayProto_values, array_values_iterator) \
5934+
F(ErrorPrototype, initial_error_prototype) \
5935+
F(IteratorPrototype, initial_iterator_prototype) \
5936+
F(ObjProto_valueOf, object_value_of_function)
59365937

59375938
enum Intrinsic {
59385939
#define V8_DECL_INTRINSIC(name, iname) k##name,

deps/v8/src/init/bootstrapper.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,9 +1551,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
15511551
isolate_, isolate_->initial_object_prototype(), "toString",
15521552
Builtins::kObjectPrototypeToString, 0, true);
15531553
native_context()->set_object_to_string(*object_to_string);
1554-
SimpleInstallFunction(isolate_, isolate_->initial_object_prototype(),
1555-
"valueOf", Builtins::kObjectPrototypeValueOf, 0,
1556-
true);
1554+
Handle<JSFunction> object_value_of = SimpleInstallFunction(
1555+
isolate_, isolate_->initial_object_prototype(), "valueOf",
1556+
Builtins::kObjectPrototypeValueOf, 0, true);
1557+
native_context()->set_object_value_of_function(*object_value_of);
15571558

15581559
SimpleInstallGetterSetter(
15591560
isolate_, isolate_->initial_object_prototype(), factory->proto_string(),

deps/v8/src/objects/contexts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ enum ContextLookupFlags {
348348
V(MAP_SET_INDEX, JSFunction, map_set) \
349349
V(FUNCTION_HAS_INSTANCE_INDEX, JSFunction, function_has_instance) \
350350
V(OBJECT_TO_STRING, JSFunction, object_to_string) \
351+
V(OBJECT_VALUE_OF_FUNCTION_INDEX, JSFunction, object_value_of_function) \
351352
V(PROMISE_ALL_INDEX, JSFunction, promise_all) \
352353
V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
353354
V(PROMISE_FUNCTION_INDEX, JSFunction, promise_function) \

0 commit comments

Comments
 (0)