@@ -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