]> git.saurik.com Git - cycript.git/commitdiff
Do not output class extension syntax for Object{}.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Jan 2016 21:42:30 +0000 (13:42 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Jan 2016 21:42:30 +0000 (13:42 -0800)
Execute.cpp
String.hpp

index e11542abab5757364b7d6e06bf23dc08725cc923..52bc453e2aac211b04755856c9624eab0b22dd06 100644 (file)
@@ -517,8 +517,11 @@ const char *CYPoolCCYON(CYPool &pool, JSContextRef context, JSObjectRef object,
 
         if (CYIsStrictEqual(context, theory, practice)) {
             JSValueRef name(CYGetProperty(context, constructor, name_s));
-            if (!JSValueIsUndefined(context, name))
-                str << "new" << ' ' << CYPoolUTF8String(pool, context, CYJSString(context, name));
+            if (!JSValueIsUndefined(context, name)) {
+                auto utf8(CYPoolUTF8String(pool, context, CYJSString(context, name)));
+                if (utf8 != "Object")
+                    str << "new" << ' ' << utf8;
+            }
         }
     }
 
index 14599fbc36f32f43943f2b2ff999858620091cea..75e659c6339db7c446ff80fc56c4c45797bea0eb 100644 (file)
@@ -54,6 +54,11 @@ struct CYUTF8String {
         return length == size && memcmp(value, data, length) == 0;
     }
 
+    bool operator !=(const char *value) const {
+        size_t length(strlen(data));
+        return length != size || memcmp(value, data, length) != 0;
+    }
+
     operator std::string() const {
         return std::string(data, size);
     }