Well, in the version with returns it is:

----------------------------------------------------------------------------
        cgThings.append(CGGeneric('  JS::Rooted<JSObject*> stack(cx);           
                 \n'))
        cgThings.append(CGGeneric('  if (!JS::CaptureCurrentStack(cx, &stack, 
1)) {              \n'))
        cgThings.append(CGGeneric('    return false;                            
                 \n'))
        cgThings.append(CGGeneric('  }                                          
                 \n'))
        cgThings.append(CGGeneric('  JS::Rooted<JS::Value> source(cx);          
                 \n'))
        cgThings.append(CGGeneric('  if (!JS_GetProperty(cx, stack, "source", 
&source)) {        \n'))
        cgThings.append(CGGeneric('    return false;                            
                 \n'))
        cgThings.append(CGGeneric('  }                                          
                 \n'))
        cgThings.append(CGGeneric('  if (source.isString()) {                   
                 \n'))
        cgThings.append(CGGeneric('    nsAutoJSString str;                      
                 \n'))
        cgThings.append(CGGeneric('    if (!str.init(cx, source.toString())) {  
                 \n'))
        cgThings.append(CGGeneric('      return false;                          
                 \n'))
        cgThings.append(CGGeneric('    }                                        
                 \n'))
        cgThings.append(CGGeneric('    printf("FULL: %s\\n", 
NS_ConvertUTF16toUTF8(str).get());  \n'))
        cgThings.append(CGGeneric('  }                                          
                 \n'))
----------------------------------------------------------------------------

Both versions (with returns and conditional statements) compile fine. However, 
neither of them works. Both versions crash on browser startup on:

JS_GetProperty(cx, stack, "source", &source)

Tomasz
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to