Skip to content

Commit

Permalink
chore: update escargot with SymbolRef API modifications
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 committed Apr 19, 2024
1 parent 3be4882 commit b038175
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deps/escargot
Submodule escargot updated 199 files
1 change: 1 addition & 0 deletions escargot.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'escargot_configs': [
'-DESCARGOT_SMALL_CONFIG=1',
'-DESCARGOT_USE_CUSTOM_LOGGING=ON',
'-DESCARGOT_USE_EXTENDED_API=ON',
'-DESCARGOT_ARCH=<(target_arch)',
'-DESCARGOT_HOST=<(build_host)',
'-DESCARGOT_MODE=<(escargot_build_mode)',
Expand Down
8 changes: 4 additions & 4 deletions src/api-data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2314,14 +2314,14 @@ void String::ExternalStringResourceBase::operator delete(void* ptr) {

Local<Value> Symbol::Description() const {
auto lwIsolate = IsolateWrap::GetCurrent();
auto esDescription = CVAL(this)->value()->asSymbol()->description();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription.get());
auto esDescription = CVAL(this)->value()->asSymbol()->descriptionString();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription);
}

Local<Value> Private::Name() const {
auto lwIsolate = IsolateWrap::GetCurrent();
auto esDescription = CVAL(this)->value()->asSymbol()->description();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription.get());
auto esDescription = CVAL(this)->value()->asSymbol()->descriptionString();
return Utils::NewLocal<String>(lwIsolate->toV8(), esDescription);
}

template <typename T, typename F>
Expand Down
5 changes: 4 additions & 1 deletion src/api/es-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ EvalResult ObjectRefHelper::setPrototype(ContextRef* context,
[](ExecutionStateRef* state,
ObjectRef* object,
ValueRef* prototype) -> ValueRef* {
return ValueRef::create(object->setPrototype(state, prototype));
// call ObjectRef::setObjectPrototype instead of ObjectRef::setPrototype
// here because ImmutablePrototypeObject blocks __proto__ property
// setting
return ValueRef::create(object->setObjectPrototype(state, prototype));
},
object,
prototype);
Expand Down
8 changes: 4 additions & 4 deletions src/api/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ SymbolRef* IsolateWrap::createApiSymbol(StringRef* name) {
auto newSymbol = SymbolRef::create(name);
bool found = false;
for (size_t i = 0; i < apiSymbols_.size(); i++) {
if (apiSymbols_[i]->description()->equals(name)) {
if (apiSymbols_[i]->descriptionString()->equals(name)) {
apiSymbols_[i] = newSymbol;
found = true;
break;
Expand All @@ -596,7 +596,7 @@ SymbolRef* IsolateWrap::getApiSymbol(StringRef* name) {
LWNODE_CALL_TRACE_ID(ISOWRAP);

for (auto apiSymbols : apiSymbols_) {
if (apiSymbols->description()->equals(name)) {
if (apiSymbols->descriptionString()->equals(name)) {
return apiSymbols;
}
}
Expand All @@ -609,7 +609,7 @@ SymbolRef* IsolateWrap::createApiPrivateSymbol(StringRef* name) {
auto newSymbol = SymbolRef::create(name);
bool found = false;
for (size_t i = 0; i < apiPrivateSymbols_.size(); i++) {
if (apiPrivateSymbols_[i]->description()->equals(name)) {
if (apiPrivateSymbols_[i]->descriptionString()->equals(name)) {
apiPrivateSymbols_[i] = newSymbol;
found = true;
break;
Expand All @@ -630,7 +630,7 @@ SymbolRef* IsolateWrap::getApiPrivateSymbol(StringRef* name) {
LWNODE_CALL_TRACE_ID(ISOWRAP);

for (auto apiPrivateSymbol : apiPrivateSymbols_) {
if (apiPrivateSymbol->description()->equals(name)) {
if (apiPrivateSymbol->descriptionString()->equals(name)) {
return apiPrivateSymbol;
}
}
Expand Down

0 comments on commit b038175

Please sign in to comment.