Changeset 35775 in webkit for trunk/JavaScriptCore/API/JSBase.cpp


Ignore:
Timestamp:
Aug 15, 2008, 12:43:48 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

JSStringRef is created context-free, but can get linked to one via an identifier table,
breaking an implicit API contract.

Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSBase.cpp

    r35604 r35775  
    3030#include "APICast.h"
    3131#include "completion.h"
     32#include "OpaqueJSString.h"
    3233#include <kjs/ExecState.h>
    3334#include <kjs/InitializeThreading.h>
     
    4445
    4546    JSObject* jsThisObject = toJS(thisObject);
    46     UString::Rep* scriptRep = toJS(script);
    47     UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null;
    4847
    4948    // Interpreter::evaluate sets "this" to the global object if it is NULL
    5049    JSGlobalObject* globalObject = exec->dynamicGlobalObject();
    51     Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject);
     50    Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), sourceURL->ustring(), startingLineNumber, script->ustring(), jsThisObject);
    5251
    5352    if (completion.complType() == Throw) {
     
    6968    exec->globalData().heap->registerThread();
    7069
    71     UString::Rep* scriptRep = toJS(script);
    72     UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null;
    73     Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep));
     70    Completion completion = Interpreter::checkSyntax(exec->dynamicGlobalObject()->globalExec(), sourceURL->ustring(), startingLineNumber, script->ustring());
    7471    if (completion.complType() == Throw) {
    7572        if (exception)
Note: See TracChangeset for help on using the changeset viewer.