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

Commit f7494bb

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

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
@@ -1528,7 +1528,6 @@ class V8_EXPORT ObjectTemplate : public Template {
15281528

15291529
Local<Object> NewInstance();
15301530
void SetClassName(Handle<String> name);
1531-
void SetSupportsOverrideToString();
15321531

15331532
void SetAccessor(
15341533
Handle<String> name,

deps/chakrashim/src/v8objecttemplate.cc

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

4645
ObjectTemplateData()
4746
: namedPropertyGetter(nullptr),
@@ -54,8 +53,7 @@ struct ObjectTemplateData : public TemplateData {
5453
indexedPropertyQuery(nullptr),
5554
indexedPropertyDeleter(nullptr),
5655
indexedPropertyEnumerator(nullptr),
57-
internalFieldCount(0),
58-
supportsOverrideToString(false) {
56+
internalFieldCount(0) {
5957
HandleScope scope(nullptr);
6058
properties = Object::New();
6159
}
@@ -879,23 +877,6 @@ Local<Object> ObjectTemplate::NewInstance(Handle<Object> prototype) {
879877
if (error != JsNoError) {
880878
return Local<Object>();
881879
}
882-
883-
// this trick is needed in order to support the equals operator correctly:
884-
if (objectTemplateData->supportsOverrideToString) {
885-
JsValueRef proxyRef = newInstanceRef;
886-
887-
error = JsCreateObject(&newInstanceRef);
888-
889-
if (error != JsNoError) {
890-
return Local<Object>();
891-
}
892-
893-
error = JsSetPrototype(newInstanceRef, proxyRef);
894-
895-
if (error != JsNoError) {
896-
return Local<Object>();
897-
}
898-
}
899880
}
900881

901882
// clone the object template into the new instance
@@ -1061,15 +1042,4 @@ Handle<String> ObjectTemplate::GetClassName() {
10611042
return objectTemplateData->className;
10621043
}
10631044

1064-
void ObjectTemplate::SetSupportsOverrideToString() {
1065-
void* externalData;
1066-
if (JsGetExternalData(this, &externalData) != JsNoError) {
1067-
return;
1068-
}
1069-
1070-
ObjectTemplateData *objectTemplateData =
1071-
reinterpret_cast<ObjectTemplateData*>(externalData);
1072-
objectTemplateData->supportsOverrideToString = true;
1073-
}
1074-
10751045
} // namespace v8

0 commit comments

Comments
 (0)