Changeset 27879 in webkit for trunk/JavaScriptCore/API


Ignore:
Timestamp:
Nov 17, 2007, 3:14:40 PM (18 years ago)
Author:
[email protected]
Message:

2007-11-17 Alp Toker <[email protected]>

Reviewed by Eric.

http://bugs.webkit.org/show_bug.cgi?id=16032
JS minidom is not portable

Use a plain UTF-8 string instead of a CFString.

Print to stdout, not stderr like CFShow() would have done, since that
behaviour seems unintentional.

  • API/minidom.c: (main):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/minidom.c

    r27207 r27879  
    22/*
    33 * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
     4 * Copyright (C) 2007 Alp Toker <[email protected]>
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    2627
    2728#include "JSNode.h"
     29#include <stdio.h>
     30#include <stdlib.h>
    2831#include <wtf/Assertions.h>
    2932#include <wtf/UnusedParam.h>
     
    5760        printf("FAIL: Test script threw exception:\n");
    5861        JSStringRef exceptionIString = JSValueToStringCopy(context, exception, NULL);
    59         CFStringRef exceptionCF = JSStringCopyCFString(kCFAllocatorDefault, exceptionIString);
    60         CFShow(exceptionCF);
    61         CFRelease(exceptionCF);
     62        size_t exceptionUTF8Size = JSStringGetMaximumUTF8CStringSize(exceptionIString);
     63        char* exceptionUTF8 = (char*)malloc(exceptionUTF8Size);
     64        JSStringGetUTF8CString(exceptionIString, exceptionUTF8, exceptionUTF8Size);
     65        printf("%s\n", exceptionUTF8);
     66        free(exceptionUTF8);
    6267        JSStringRelease(exceptionIString);
    6368    }
Note: See TracChangeset for help on using the changeset viewer.