-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround Object.freeze() for JSI hosted object.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/src/objects/js-objects.cc b/src/objects/js-objects.cc | ||
index 3666f5a..d17dba4 100644 | ||
--- a/src/objects/js-objects.cc | ||
+++ b/src/objects/js-objects.cc | ||
@@ -3815,24 +3815,25 @@ Maybe<bool> JSObject::PreventExtensionsWithTransition( | ||
PrototypeIterator::GetCurrent<JSObject>(iter), should_throw); | ||
} | ||
|
||
- if (object->map().has_named_interceptor() || | ||
- object->map().has_indexed_interceptor()) { | ||
- MessageTemplate message = MessageTemplate::kNone; | ||
- switch (attrs) { | ||
- case NONE: | ||
- message = MessageTemplate::kCannotPreventExt; | ||
- break; | ||
- | ||
- case SEALED: | ||
- message = MessageTemplate::kCannotSeal; | ||
- break; | ||
- | ||
- case FROZEN: | ||
- message = MessageTemplate::kCannotFreeze; | ||
- break; | ||
- } | ||
- RETURN_FAILURE(isolate, should_throw, NewTypeError(message)); | ||
- } | ||
+ // Workaround Object.freeze() for JSI hosted object - https://github.com/Kudo/react-native-v8/issues/27 | ||
+ // if (object->map().has_named_interceptor() || | ||
+ // object->map().has_indexed_interceptor()) { | ||
+ // MessageTemplate message = MessageTemplate::kNone; | ||
+ // switch (attrs) { | ||
+ // case NONE: | ||
+ // message = MessageTemplate::kCannotPreventExt; | ||
+ // break; | ||
+ // | ||
+ // case SEALED: | ||
+ // message = MessageTemplate::kCannotSeal; | ||
+ // break; | ||
+ // | ||
+ // case FROZEN: | ||
+ // message = MessageTemplate::kCannotFreeze; | ||
+ // break; | ||
+ // } | ||
+ // RETURN_FAILURE(isolate, should_throw, NewTypeError(message)); | ||
+ // } | ||
|
||
Handle<Symbol> transition_marker; | ||
if (attrs == NONE) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters