Permalink
Browse files

Added warning for possible iPhone symbol fetch failure

  • Loading branch information...
1 parent 09e6741 commit 32a49dc6b30200ff2b9139c0c4ad5af9f7a20c52 @parmanoir committed Nov 28, 2011
@@ -2471,11 +2471,13 @@ members)?
if (!t.block) {
// ## Only warn about missing semicolons when next token is on same line and not a closing brace (like in one line closures)
if (nexttoken.id !== ';') {
-/*
- if (token.line == nexttoken.line && nexttoken.id != '}')
-// alert('THERE')
- warningAt("@@@Missing semicolon.", token.line, token.from + token.value.length);
-*/
+ if (token.line == nexttoken.line && nexttoken.id != '}') {
+ // Allow 'new Date' as a valid expression
+ var isNewExpression = token.value == 'new' && token.line != prevtoken.line
+ if (!isNewExpression)
+ warningAt("@@@Missing semicolon.", token.line, token.from + token.value.length);
+ }
+
//##
// warningAt("Missing semicolon.", token.line,
// token.from + token.value.length);
@@ -2,4 +2,20 @@
<Bucket
type = "1"
version = "1.0">
+ <FileBreakpoints>
+ <FileBreakpoint
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ isPathRelative = "0"
+ filePath = "/Users/mini/Software Inexdo/JSCocoa/JSCocoa/JSCocoaController.m"
+ timestampString = "344212350.164938"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "174"
+ endingLineNumber = "174"
+ landmarkName = "-initWithGlobalContext:"
+ landmarkType = "5">
+ </FileBreakpoint>
+ </FileBreakpoints>
</Bucket>
@@ -453,73 +453,80 @@ void JSValueUnprotect(JSContextRef ctx, JSValueRef value)
@implementation JSCocoaSymbolFetcher
+ (void)populateJavascriptCoreSymbols
{
- _JSEvaluateScript = dlsym(RTLD_DEFAULT, "JSEvaluateScript");
- _JSCheckScriptSyntax = dlsym(RTLD_DEFAULT, "JSCheckScriptSyntax");
- _JSGarbageCollect = dlsym(RTLD_DEFAULT, "JSGarbageCollect");
- _JSGlobalContextCreate = dlsym(RTLD_DEFAULT, "JSGlobalContextCreate");
- _JSGlobalContextRetain = dlsym(RTLD_DEFAULT, "JSGlobalContextRetain");
- _JSGlobalContextRelease = dlsym(RTLD_DEFAULT, "JSGlobalContextRelease");
- _JSContextGetGlobalObject = dlsym(RTLD_DEFAULT, "JSContextGetGlobalObject");
- _JSClassCreate = dlsym(RTLD_DEFAULT, "JSClassCreate");
- _JSClassRetain = dlsym(RTLD_DEFAULT, "JSClassRetain");
- _JSClassRelease = dlsym(RTLD_DEFAULT, "JSClassRelease");
- _JSObjectMake = dlsym(RTLD_DEFAULT, "JSObjectMake");
- _JSObjectMakeFunctionWithCallback = dlsym(RTLD_DEFAULT, "JSObjectMakeFunctionWithCallback");
- _JSObjectMakeConstructor = dlsym(RTLD_DEFAULT, "JSObjectMakeConstructor");
- _JSObjectMakeFunction = dlsym(RTLD_DEFAULT, "JSObjectMakeFunction");
- _JSObjectGetPrototype = dlsym(RTLD_DEFAULT, "JSObjectGetPrototype");
- _JSObjectSetPrototype = dlsym(RTLD_DEFAULT, "JSObjectSetPrototype");
- _JSObjectHasProperty = dlsym(RTLD_DEFAULT, "JSObjectHasProperty");
- _JSObjectGetProperty = dlsym(RTLD_DEFAULT, "JSObjectGetProperty");
- _JSObjectSetProperty = dlsym(RTLD_DEFAULT, "JSObjectSetProperty");
- _JSObjectDeleteProperty = dlsym(RTLD_DEFAULT, "JSObjectDeleteProperty");
- _JSObjectGetPropertyAtIndex = dlsym(RTLD_DEFAULT, "JSObjectGetPropertyAtIndex");
- _JSObjectSetPropertyAtIndex = dlsym(RTLD_DEFAULT, "JSObjectSetPropertyAtIndex");
- _JSObjectGetPrivate = dlsym(RTLD_DEFAULT, "JSObjectGetPrivate");
- _JSObjectSetPrivate = dlsym(RTLD_DEFAULT, "JSObjectSetPrivate");
- _JSObjectIsFunction = dlsym(RTLD_DEFAULT, "JSObjectIsFunction");
- _JSObjectCallAsFunction = dlsym(RTLD_DEFAULT, "JSObjectCallAsFunction");
- _JSObjectIsConstructor = dlsym(RTLD_DEFAULT, "JSObjectIsConstructor");
- _JSObjectCallAsConstructor = dlsym(RTLD_DEFAULT, "JSObjectCallAsConstructor");
- _JSObjectCopyPropertyNames = dlsym(RTLD_DEFAULT, "JSObjectCopyPropertyNames");
- _JSPropertyNameArrayRetain = dlsym(RTLD_DEFAULT, "JSPropertyNameArrayRetain");
- _JSPropertyNameArrayRelease = dlsym(RTLD_DEFAULT, "JSPropertyNameArrayRelease");
- _JSPropertyNameArrayGetCount = dlsym(RTLD_DEFAULT, "JSPropertyNameArrayGetCount");
- _JSPropertyNameArrayGetNameAtIndex = dlsym(RTLD_DEFAULT, "JSPropertyNameArrayGetNameAtIndex");
- _JSPropertyNameAccumulatorAddName = dlsym(RTLD_DEFAULT, "JSPropertyNameAccumulatorAddName");
- _JSStringCreateWithCharacters = dlsym(RTLD_DEFAULT, "JSStringCreateWithCharacters");
- _JSStringCreateWithUTF8CString = dlsym(RTLD_DEFAULT, "JSStringCreateWithUTF8CString");
- _JSStringRetain = dlsym(RTLD_DEFAULT, "JSStringRetain");
- _JSStringRelease = dlsym(RTLD_DEFAULT, "JSStringRelease");
- _JSStringGetLength = dlsym(RTLD_DEFAULT, "JSStringGetLength");
- _JSStringGetCharactersPtr = dlsym(RTLD_DEFAULT, "JSStringGetCharactersPtr");
- _JSStringGetMaximumUTF8CStringSize = dlsym(RTLD_DEFAULT, "JSStringGetMaximumUTF8CStringSize");
- _JSStringGetUTF8CString = dlsym(RTLD_DEFAULT, "JSStringGetUTF8CString");
- _JSStringIsEqual = dlsym(RTLD_DEFAULT, "JSStringIsEqual");
- _JSStringIsEqualToUTF8CString = dlsym(RTLD_DEFAULT, "JSStringIsEqualToUTF8CString");
- _JSStringCreateWithCFString = dlsym(RTLD_DEFAULT, "JSStringCreateWithCFString");
- _JSStringCopyCFString = dlsym(RTLD_DEFAULT, "JSStringCopyCFString");
- _JSValueGetType = dlsym(RTLD_DEFAULT, "JSValueGetType");
- _JSValueIsUndefined = dlsym(RTLD_DEFAULT, "JSValueIsUndefined");
- _JSValueIsNull = dlsym(RTLD_DEFAULT, "JSValueIsNull");
- _JSValueIsBoolean = dlsym(RTLD_DEFAULT, "JSValueIsBoolean");
- _JSValueIsNumber = dlsym(RTLD_DEFAULT, "JSValueIsNumber");
- _JSValueIsString = dlsym(RTLD_DEFAULT, "JSValueIsString");
- _JSValueIsObject = dlsym(RTLD_DEFAULT, "JSValueIsObject");
- _JSValueIsObjectOfClass = dlsym(RTLD_DEFAULT, "JSValueIsObjectOfClass");
- _JSValueIsEqual = dlsym(RTLD_DEFAULT, "JSValueIsEqual");
- _JSValueIsStrictEqual = dlsym(RTLD_DEFAULT, "JSValueIsStrictEqual");
- _JSValueIsInstanceOfConstructor = dlsym(RTLD_DEFAULT, "JSValueIsInstanceOfConstructor");
- _JSValueMakeUndefined = dlsym(RTLD_DEFAULT, "JSValueMakeUndefined");
- _JSValueMakeNull = dlsym(RTLD_DEFAULT, "JSValueMakeNull");
- _JSValueMakeBoolean = dlsym(RTLD_DEFAULT, "JSValueMakeBoolean");
- _JSValueMakeNumber = dlsym(RTLD_DEFAULT, "JSValueMakeNumber");
- _JSValueMakeString = dlsym(RTLD_DEFAULT, "JSValueMakeString");
- _JSValueToBoolean = dlsym(RTLD_DEFAULT, "JSValueToBoolean");
- _JSValueToNumber = dlsym(RTLD_DEFAULT, "JSValueToNumber");
- _JSValueToStringCopy = dlsym(RTLD_DEFAULT, "JSValueToStringCopy");
- _JSValueToObject = dlsym(RTLD_DEFAULT, "JSValueToObject");
- _JSValueProtect = dlsym(RTLD_DEFAULT, "JSValueProtect");
- _JSValueUnprotect = dlsym(RTLD_DEFAULT, "JSValueUnprotect");
+#define SYM_ORDER RTLD_DEFAULT
+
+ _JSEvaluateScript = dlsym(SYM_ORDER, "JSEvaluateScript");
+ if (_JSEvaluateScript == JSEvaluateScript) {
+ _JSEvaluateScript = NULL;
+ NSLog(@"JSCocoa Symbol population failed. Try switching SYM_ORDER to RTLD_NEXT");
+ return;
+ }
+ _JSCheckScriptSyntax = dlsym(SYM_ORDER, "JSCheckScriptSyntax");
+ _JSGarbageCollect = dlsym(SYM_ORDER, "JSGarbageCollect");
+ _JSGlobalContextCreate = dlsym(SYM_ORDER, "JSGlobalContextCreate");
+ _JSGlobalContextRetain = dlsym(SYM_ORDER, "JSGlobalContextRetain");
+ _JSGlobalContextRelease = dlsym(SYM_ORDER, "JSGlobalContextRelease");
+ _JSContextGetGlobalObject = dlsym(SYM_ORDER, "JSContextGetGlobalObject");
+ _JSClassCreate = dlsym(SYM_ORDER, "JSClassCreate");
+ _JSClassRetain = dlsym(SYM_ORDER, "JSClassRetain");
+ _JSClassRelease = dlsym(SYM_ORDER, "JSClassRelease");
+ _JSObjectMake = dlsym(SYM_ORDER, "JSObjectMake");
+ _JSObjectMakeFunctionWithCallback = dlsym(SYM_ORDER, "JSObjectMakeFunctionWithCallback");
+ _JSObjectMakeConstructor = dlsym(SYM_ORDER, "JSObjectMakeConstructor");
+ _JSObjectMakeFunction = dlsym(SYM_ORDER, "JSObjectMakeFunction");
+ _JSObjectGetPrototype = dlsym(SYM_ORDER, "JSObjectGetPrototype");
+ _JSObjectSetPrototype = dlsym(SYM_ORDER, "JSObjectSetPrototype");
+ _JSObjectHasProperty = dlsym(SYM_ORDER, "JSObjectHasProperty");
+ _JSObjectGetProperty = dlsym(SYM_ORDER, "JSObjectGetProperty");
+ _JSObjectSetProperty = dlsym(SYM_ORDER, "JSObjectSetProperty");
+ _JSObjectDeleteProperty = dlsym(SYM_ORDER, "JSObjectDeleteProperty");
+ _JSObjectGetPropertyAtIndex = dlsym(SYM_ORDER, "JSObjectGetPropertyAtIndex");
+ _JSObjectSetPropertyAtIndex = dlsym(SYM_ORDER, "JSObjectSetPropertyAtIndex");
+ _JSObjectGetPrivate = dlsym(SYM_ORDER, "JSObjectGetPrivate");
+ _JSObjectSetPrivate = dlsym(SYM_ORDER, "JSObjectSetPrivate");
+ _JSObjectIsFunction = dlsym(SYM_ORDER, "JSObjectIsFunction");
+ _JSObjectCallAsFunction = dlsym(SYM_ORDER, "JSObjectCallAsFunction");
+ _JSObjectIsConstructor = dlsym(SYM_ORDER, "JSObjectIsConstructor");
+ _JSObjectCallAsConstructor = dlsym(SYM_ORDER, "JSObjectCallAsConstructor");
+ _JSObjectCopyPropertyNames = dlsym(SYM_ORDER, "JSObjectCopyPropertyNames");
+ _JSPropertyNameArrayRetain = dlsym(SYM_ORDER, "JSPropertyNameArrayRetain");
+ _JSPropertyNameArrayRelease = dlsym(SYM_ORDER, "JSPropertyNameArrayRelease");
+ _JSPropertyNameArrayGetCount = dlsym(SYM_ORDER, "JSPropertyNameArrayGetCount");
+ _JSPropertyNameArrayGetNameAtIndex = dlsym(SYM_ORDER, "JSPropertyNameArrayGetNameAtIndex");
+ _JSPropertyNameAccumulatorAddName = dlsym(SYM_ORDER, "JSPropertyNameAccumulatorAddName");
+ _JSStringCreateWithCharacters = dlsym(SYM_ORDER, "JSStringCreateWithCharacters");
+ _JSStringCreateWithUTF8CString = dlsym(SYM_ORDER, "JSStringCreateWithUTF8CString");
+ _JSStringRetain = dlsym(SYM_ORDER, "JSStringRetain");
+ _JSStringRelease = dlsym(SYM_ORDER, "JSStringRelease");
+ _JSStringGetLength = dlsym(SYM_ORDER, "JSStringGetLength");
+ _JSStringGetCharactersPtr = dlsym(SYM_ORDER, "JSStringGetCharactersPtr");
+ _JSStringGetMaximumUTF8CStringSize = dlsym(SYM_ORDER, "JSStringGetMaximumUTF8CStringSize");
+ _JSStringGetUTF8CString = dlsym(SYM_ORDER, "JSStringGetUTF8CString");
+ _JSStringIsEqual = dlsym(SYM_ORDER, "JSStringIsEqual");
+ _JSStringIsEqualToUTF8CString = dlsym(SYM_ORDER, "JSStringIsEqualToUTF8CString");
+ _JSStringCreateWithCFString = dlsym(SYM_ORDER, "JSStringCreateWithCFString");
+ _JSStringCopyCFString = dlsym(SYM_ORDER, "JSStringCopyCFString");
+ _JSValueGetType = dlsym(SYM_ORDER, "JSValueGetType");
+ _JSValueIsUndefined = dlsym(SYM_ORDER, "JSValueIsUndefined");
+ _JSValueIsNull = dlsym(SYM_ORDER, "JSValueIsNull");
+ _JSValueIsBoolean = dlsym(SYM_ORDER, "JSValueIsBoolean");
+ _JSValueIsNumber = dlsym(SYM_ORDER, "JSValueIsNumber");
+ _JSValueIsString = dlsym(SYM_ORDER, "JSValueIsString");
+ _JSValueIsObject = dlsym(SYM_ORDER, "JSValueIsObject");
+ _JSValueIsObjectOfClass = dlsym(SYM_ORDER, "JSValueIsObjectOfClass");
+ _JSValueIsEqual = dlsym(SYM_ORDER, "JSValueIsEqual");
+ _JSValueIsStrictEqual = dlsym(SYM_ORDER, "JSValueIsStrictEqual");
+ _JSValueIsInstanceOfConstructor = dlsym(SYM_ORDER, "JSValueIsInstanceOfConstructor");
+ _JSValueMakeUndefined = dlsym(SYM_ORDER, "JSValueMakeUndefined");
+ _JSValueMakeNull = dlsym(SYM_ORDER, "JSValueMakeNull");
+ _JSValueMakeBoolean = dlsym(SYM_ORDER, "JSValueMakeBoolean");
+ _JSValueMakeNumber = dlsym(SYM_ORDER, "JSValueMakeNumber");
+ _JSValueMakeString = dlsym(SYM_ORDER, "JSValueMakeString");
+ _JSValueToBoolean = dlsym(SYM_ORDER, "JSValueToBoolean");
+ _JSValueToNumber = dlsym(SYM_ORDER, "JSValueToNumber");
+ _JSValueToStringCopy = dlsym(SYM_ORDER, "JSValueToStringCopy");
+ _JSValueToObject = dlsym(SYM_ORDER, "JSValueToObject");
+ _JSValueProtect = dlsym(SYM_ORDER, "JSValueProtect");
+ _JSValueUnprotect = dlsym(SYM_ORDER, "JSValueUnprotect");
}
@end
@@ -14,7 +14,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "3873"
endingLineNumber = "3873"
- landmarkName = "jsCocoaObject_setProperty()"
+ landmarkName = "jsCocoaObject_getProperty()"
landmarkType = "7">
</FileBreakpoint>
<FileBreakpoint
@@ -28,7 +28,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "3873"
endingLineNumber = "3873"
- landmarkName = "jsCocoaObject_setProperty()"
+ landmarkName = "jsCocoaObject_getProperty()"
landmarkType = "7">
</FileBreakpoint>
<FileBreakpoint
@@ -42,7 +42,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "3848"
endingLineNumber = "3848"
- landmarkName = "jsCocoaObject_setProperty()"
+ landmarkName = "jsCocoaObject_getProperty()"
landmarkType = "7">
</FileBreakpoint>
<FileBreakpoint

0 comments on commit 32a49dc

Please sign in to comment.