Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 7f4cf1f

Browse files
author
Jianchun Xu
committed
chakrashim: remove supportsOverrideToString
"supportsOverrideToString" was originally added to make old FastBuffer work. Buffer has long switched to TypedArray implementation. This is no longer used. Fix #80 Reviewed-by: @kunalspathak
1 parent 47477f6 commit 7f4cf1f

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

deps/chakrashim/include/v8.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,6 @@ class V8_EXPORT ObjectTemplate : public Template {
18621862
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
18631863

18641864
void SetClassName(Handle<String> name);
1865-
void SetSupportsOverrideToString();
18661865

18671866
void SetAccessor(Handle<String> name,
18681867
AccessorGetterCallback getter,

deps/chakrashim/src/v8objecttemplate.cc

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ struct ObjectTemplateData : public TemplateData {
4040
IndexedPropertyEnumeratorCallback indexedPropertyEnumerator;
4141
Persistent<Value> indexedPropertyInterceptorData;
4242
int internalFieldCount;
43-
bool supportsOverrideToString;
4443

4544
ObjectTemplateData()
4645
: namedPropertyGetter(nullptr),
@@ -53,8 +52,7 @@ struct ObjectTemplateData : public TemplateData {
5352
indexedPropertyQuery(nullptr),
5453
indexedPropertyDeleter(nullptr),
5554
indexedPropertyEnumerator(nullptr),
56-
internalFieldCount(0),
57-
supportsOverrideToString(false) {
55+
internalFieldCount(0) {
5856
HandleScope scope(nullptr);
5957
properties = Object::New();
6058
}
@@ -877,23 +875,6 @@ Local<Object> ObjectTemplate::NewInstance(Handle<Object> prototype) {
877875
if (error != JsNoError) {
878876
return Local<Object>();
879877
}
880-
881-
// this trick is needed in order to support the equals operator correctly:
882-
if (objectTemplateData->supportsOverrideToString) {
883-
JsValueRef proxyRef = newInstanceRef;
884-
885-
error = JsCreateObject(&newInstanceRef);
886-
887-
if (error != JsNoError) {
888-
return Local<Object>();
889-
}
890-
891-
error = JsSetPrototype(newInstanceRef, proxyRef);
892-
893-
if (error != JsNoError) {
894-
return Local<Object>();
895-
}
896-
}
897878
}
898879

899880
// clone the object template into the new instance
@@ -1092,15 +1073,4 @@ Handle<String> ObjectTemplate::GetClassName() {
10921073
return objectTemplateData->className;
10931074
}
10941075

1095-
void ObjectTemplate::SetSupportsOverrideToString() {
1096-
void* externalData;
1097-
if (JsGetExternalData(this, &externalData) != JsNoError) {
1098-
return;
1099-
}
1100-
1101-
ObjectTemplateData *objectTemplateData =
1102-
reinterpret_cast<ObjectTemplateData*>(externalData);
1103-
objectTemplateData->supportsOverrideToString = true;
1104-
}
1105-
11061076
} // namespace v8

0 commit comments

Comments
 (0)