diff options
Diffstat (limited to 'WebCore/bindings/js')
64 files changed, 704 insertions, 734 deletions
diff --git a/WebCore/bindings/js/CachedScriptSourceProvider.h b/WebCore/bindings/js/CachedScriptSourceProvider.h index 8e69b6b..809a488 100644 --- a/WebCore/bindings/js/CachedScriptSourceProvider.h +++ b/WebCore/bindings/js/CachedScriptSourceProvider.h @@ -29,6 +29,7 @@ #include "CachedResourceClient.h" #include "CachedResourceHandle.h" #include "CachedScript.h" +#include "JSDOMBinding.h" // for stringToUString #include "ScriptSourceProvider.h" #include <parser/SourceCode.h> diff --git a/WebCore/bindings/js/JSArrayBufferViewCustom.cpp b/WebCore/bindings/js/JSArrayBufferViewCustom.cpp index 271d096..a865a30 100644 --- a/WebCore/bindings/js/JSArrayBufferViewCustom.cpp +++ b/WebCore/bindings/js/JSArrayBufferViewCustom.cpp @@ -67,23 +67,23 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ArrayBu return jsUndefined(); } -JSValue JSArrayBufferView::slice(ExecState* exec, const ArgList& args) +JSValue JSArrayBufferView::slice(ExecState* exec) { ArrayBufferView* array = reinterpret_cast<ArrayBufferView*>(impl()); int start, end; - switch (args.size()) { + switch (exec->argumentCount()) { case 0: start = 0; end = array->length(); break; case 1: - start = args.at(0).toInt32(exec); + start = exec->argument(0).toInt32(exec); end = array->length(); break; default: - start = args.at(0).toInt32(exec); - end = args.at(1).toInt32(exec); + start = exec->argument(0).toInt32(exec); + end = exec->argument(1).toInt32(exec); } return toJS(exec, globalObject(), array->slice(start, end)); } diff --git a/WebCore/bindings/js/JSArrayBufferViewHelper.h b/WebCore/bindings/js/JSArrayBufferViewHelper.h index 7243db6..6b77c0c 100644 --- a/WebCore/bindings/js/JSArrayBufferViewHelper.h +++ b/WebCore/bindings/js/JSArrayBufferViewHelper.h @@ -38,29 +38,29 @@ namespace WebCore { template <class T> -JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, T* impl, JSC::ArgList const& args, T* (*conversionFunc)(JSC::JSValue)) +JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, T* impl, T* (*conversionFunc)(JSC::JSValue)) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return throwError(exec, JSC::SyntaxError); - T* array = (*conversionFunc)(args.at(0)); + T* array = (*conversionFunc)(exec->argument(0)); if (array) { // void set(in WebGL<T>Array array, [Optional] in unsigned long offset); unsigned offset = 0; - if (args.size() == 2) - offset = args.at(1).toInt32(exec); + if (exec->argumentCount() == 2) + offset = exec->argument(1).toInt32(exec); ExceptionCode ec = 0; impl->set(array, offset, ec); setDOMException(exec, ec); return JSC::jsUndefined(); } - if (args.at(0).isObject()) { + if (exec->argument(0).isObject()) { // void set(in sequence<long> array, [Optional] in unsigned long offset); - JSC::JSObject* array = JSC::asObject(args.at(0)); + JSC::JSObject* array = JSC::asObject(exec->argument(0)); uint32_t offset = 0; - if (args.size() == 2) - offset = args.at(1).toInt32(exec); + if (exec->argumentCount() == 2) + offset = exec->argument(1).toInt32(exec); uint32_t length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec); if (offset > impl->length() || offset + length > impl->length() diff --git a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp index f8aa5a7..416f976 100644 --- a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp +++ b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp @@ -89,7 +89,7 @@ void JSCanvasRenderingContext2D::setFillStyle(ExecState* exec, JSValue value) context->setFillStyle(toHTMLCanvasStyle(exec, value)); } -JSValue JSCanvasRenderingContext2D::setFillColor(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::setFillColor(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); @@ -99,26 +99,26 @@ JSValue JSCanvasRenderingContext2D::setFillColor(ExecState* exec, const ArgList& // number arg, number arg = gray color, alpha // 4 args = r, g, b, a // 5 args = c, m, y, k, a - switch (args.size()) { + switch (exec->argumentCount()) { case 1: - if (args.at(0).isString()) - context->setFillColor(ustringToString(asString(args.at(0))->value(exec))); + if (exec->argument(0).isString()) + context->setFillColor(ustringToString(asString(exec->argument(0))->value(exec))); else - context->setFillColor(args.at(0).toFloat(exec)); + context->setFillColor(exec->argument(0).toFloat(exec)); break; case 2: - if (args.at(0).isString()) - context->setFillColor(ustringToString(asString(args.at(0))->value(exec)), args.at(1).toFloat(exec)); + if (exec->argument(0).isString()) + context->setFillColor(ustringToString(asString(exec->argument(0))->value(exec)), exec->argument(1).toFloat(exec)); else - context->setFillColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec)); + context->setFillColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec)); break; case 4: - context->setFillColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + context->setFillColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); break; case 5: - context->setFillColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), args.at(4).toFloat(exec)); + context->setFillColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)); break; default: return throwError(exec, SyntaxError); @@ -126,7 +126,7 @@ JSValue JSCanvasRenderingContext2D::setFillColor(ExecState* exec, const ArgList& return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::setStrokeColor(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::setStrokeColor(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); @@ -136,26 +136,26 @@ JSValue JSCanvasRenderingContext2D::setStrokeColor(ExecState* exec, const ArgLis // number arg, number arg = gray color, alpha // 4 args = r, g, b, a // 5 args = c, m, y, k, a - switch (args.size()) { + switch (exec->argumentCount()) { case 1: - if (args.at(0).isString()) - context->setStrokeColor(ustringToString(asString(args.at(0))->value(exec))); + if (exec->argument(0).isString()) + context->setStrokeColor(ustringToString(asString(exec->argument(0))->value(exec))); else - context->setStrokeColor(args.at(0).toFloat(exec)); + context->setStrokeColor(exec->argument(0).toFloat(exec)); break; case 2: - if (args.at(0).isString()) - context->setStrokeColor(ustringToString(asString(args.at(0))->value(exec)), args.at(1).toFloat(exec)); + if (exec->argument(0).isString()) + context->setStrokeColor(ustringToString(asString(exec->argument(0))->value(exec)), exec->argument(1).toFloat(exec)); else - context->setStrokeColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec)); + context->setStrokeColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec)); break; case 4: - context->setStrokeColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + context->setStrokeColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); break; case 5: - context->setStrokeColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), args.at(4).toFloat(exec)); + context->setStrokeColor(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)); break; default: return throwError(exec, SyntaxError); @@ -164,21 +164,21 @@ JSValue JSCanvasRenderingContext2D::setStrokeColor(ExecState* exec, const ArgLis return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::strokeRect(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::strokeRect(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); - if (args.size() <= 4) - context->strokeRect(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + if (exec->argumentCount() <= 4) + context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); else - context->strokeRect(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), args.at(4).toFloat(exec)); + context->strokeRect(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)); return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); @@ -188,7 +188,7 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& ar // drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh) // Composite operation is specified with globalCompositeOperation. // The img parameter can be a <img> or <canvas> element. - JSValue value = args.at(0); + JSValue value = exec->argument(0); if (!value.isObject()) return throwError(exec, TypeError); JSObject* o = asObject(value); @@ -196,20 +196,20 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& ar ExceptionCode ec = 0; if (o->inherits(&JSHTMLImageElement::s_info)) { HTMLImageElement* imgElt = static_cast<HTMLImageElement*>(static_cast<JSHTMLElement*>(o)->impl()); - switch (args.size()) { + switch (exec->argumentCount()) { case 3: - context->drawImage(imgElt, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec); + context->drawImage(imgElt, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), ec); break; case 5: - context->drawImage(imgElt, args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec), ec); + context->drawImage(imgElt, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec), ec); setDOMException(exec, ec); break; case 9: - context->drawImage(imgElt, FloatRect(args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec)), - FloatRect(args.at(5).toFloat(exec), args.at(6).toFloat(exec), - args.at(7).toFloat(exec), args.at(8).toFloat(exec)), ec); + context->drawImage(imgElt, FloatRect(exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)), + FloatRect(exec->argument(5).toFloat(exec), exec->argument(6).toFloat(exec), + exec->argument(7).toFloat(exec), exec->argument(8).toFloat(exec)), ec); setDOMException(exec, ec); break; default: @@ -217,20 +217,20 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& ar } } else if (o->inherits(&JSHTMLCanvasElement::s_info)) { HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLElement*>(o)->impl()); - switch (args.size()) { + switch (exec->argumentCount()) { case 3: - context->drawImage(canvas, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec); + context->drawImage(canvas, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), ec); break; case 5: - context->drawImage(canvas, args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec), ec); + context->drawImage(canvas, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec), ec); setDOMException(exec, ec); break; case 9: - context->drawImage(canvas, FloatRect(args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec)), - FloatRect(args.at(5).toFloat(exec), args.at(6).toFloat(exec), - args.at(7).toFloat(exec), args.at(8).toFloat(exec)), ec); + context->drawImage(canvas, FloatRect(exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)), + FloatRect(exec->argument(5).toFloat(exec), exec->argument(6).toFloat(exec), + exec->argument(7).toFloat(exec), exec->argument(8).toFloat(exec)), ec); setDOMException(exec, ec); break; default: @@ -239,20 +239,20 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& ar #if ENABLE(VIDEO) } else if (o->inherits(&JSHTMLVideoElement::s_info)) { HTMLVideoElement* video = static_cast<HTMLVideoElement*>(static_cast<JSHTMLElement*>(o)->impl()); - switch (args.size()) { + switch (exec->argumentCount()) { case 3: - context->drawImage(video, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec); + context->drawImage(video, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), ec); break; case 5: - context->drawImage(video, args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec), ec); + context->drawImage(video, exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec), ec); setDOMException(exec, ec); break; case 9: - context->drawImage(video, FloatRect(args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec)), - FloatRect(args.at(5).toFloat(exec), args.at(6).toFloat(exec), - args.at(7).toFloat(exec), args.at(8).toFloat(exec)), ec); + context->drawImage(video, FloatRect(exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec)), + FloatRect(exec->argument(5).toFloat(exec), exec->argument(6).toFloat(exec), + exec->argument(7).toFloat(exec), exec->argument(8).toFloat(exec)), ec); setDOMException(exec, ec); break; default: @@ -266,11 +266,11 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec, const ArgList& ar return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::drawImageFromRect(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::drawImageFromRect(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); - JSValue value = args.at(0); + JSValue value = exec->argument(0); if (!value.isObject()) return throwError(exec, TypeError); JSObject* o = asObject(value); @@ -278,52 +278,52 @@ JSValue JSCanvasRenderingContext2D::drawImageFromRect(ExecState* exec, const Arg if (!o->inherits(&JSHTMLImageElement::s_info)) return throwError(exec, TypeError); context->drawImageFromRect(static_cast<HTMLImageElement*>(static_cast<JSHTMLElement*>(o)->impl()), - args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec), - args.at(5).toFloat(exec), args.at(6).toFloat(exec), - args.at(7).toFloat(exec), args.at(8).toFloat(exec), - ustringToString(args.at(9).toString(exec))); + exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec), + exec->argument(5).toFloat(exec), exec->argument(6).toFloat(exec), + exec->argument(7).toFloat(exec), exec->argument(8).toFloat(exec), + ustringToString(exec->argument(9).toString(exec))); return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::setShadow(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::setShadow(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); - switch (args.size()) { + switch (exec->argumentCount()) { case 3: - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec)); + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec)); break; case 4: - if (args.at(3).isString()) - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), ustringToString(asString(args.at(3))->value(exec))); + if (exec->argument(3).isString()) + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), ustringToString(asString(exec->argument(3))->value(exec))); else - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); break; case 5: - if (args.at(3).isString()) - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), ustringToString(asString(args.at(3))->value(exec)), - args.at(4).toFloat(exec)); + if (exec->argument(3).isString()) + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), ustringToString(asString(exec->argument(3))->value(exec)), + exec->argument(4).toFloat(exec)); else - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), - args.at(4).toFloat(exec)); + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), + exec->argument(4).toFloat(exec)); break; case 7: - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), - args.at(4).toFloat(exec), args.at(5).toFloat(exec), - args.at(6).toFloat(exec)); + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), + exec->argument(4).toFloat(exec), exec->argument(5).toFloat(exec), + exec->argument(6).toFloat(exec)); break; case 8: - context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec), - args.at(2).toFloat(exec), args.at(3).toFloat(exec), - args.at(4).toFloat(exec), args.at(5).toFloat(exec), - args.at(6).toFloat(exec), args.at(7).toFloat(exec)); + context->setShadow(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), + exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec), + exec->argument(4).toFloat(exec), exec->argument(5).toFloat(exec), + exec->argument(6).toFloat(exec), exec->argument(7).toFloat(exec)); break; default: return throwError(exec, SyntaxError); @@ -332,11 +332,11 @@ JSValue JSCanvasRenderingContext2D::setShadow(ExecState* exec, const ArgList& ar return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); - JSValue value = args.at(0); + JSValue value = exec->argument(0); if (!value.isObject()) return throwError(exec, TypeError); JSObject* o = asObject(value); @@ -345,7 +345,7 @@ JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList ExceptionCode ec; JSValue pattern = toJS(exec, context->createPattern(static_cast<HTMLImageElement*>(static_cast<JSHTMLElement*>(o)->impl()), - valueToStringWithNullCheck(exec, args.at(1)), ec).get()); + valueToStringWithNullCheck(exec, exec->argument(1)), ec).get()); setDOMException(exec, ec); return pattern; } @@ -353,7 +353,7 @@ JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList ExceptionCode ec; JSValue pattern = toJS(exec, context->createPattern(static_cast<HTMLCanvasElement*>(static_cast<JSHTMLElement*>(o)->impl()), - valueToStringWithNullCheck(exec, args.at(1)), ec).get()); + valueToStringWithNullCheck(exec, exec->argument(1)), ec).get()); setDOMException(exec, ec); return pattern; } @@ -361,7 +361,7 @@ JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::createImageData(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::createImageData(ExecState* exec) { // createImageData has two variants // createImageData(ImageData) @@ -370,16 +370,16 @@ JSValue JSCanvasRenderingContext2D::createImageData(ExecState* exec, const ArgLi RefPtr<ImageData> imageData = 0; ExceptionCode ec = 0; - if (args.size() == 1) - imageData = context->createImageData(toImageData(args.at(0)), ec); - else if (args.size() == 2) - imageData = context->createImageData(args.at(0).toFloat(exec), args.at(1).toFloat(exec), ec); + if (exec->argumentCount() == 1) + imageData = context->createImageData(toImageData(exec->argument(0)), ec); + else if (exec->argumentCount() == 2) + imageData = context->createImageData(exec->argument(0).toFloat(exec), exec->argument(1).toFloat(exec), ec); setDOMException(exec, ec); return toJS(exec, globalObject(), WTF::getPtr(imageData)); } -JSValue JSCanvasRenderingContext2D::putImageData(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::putImageData(ExecState* exec) { // putImageData has two variants // putImageData(ImageData, x, y) @@ -387,17 +387,17 @@ JSValue JSCanvasRenderingContext2D::putImageData(ExecState* exec, const ArgList& CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); ExceptionCode ec = 0; - if (args.size() >= 7) - context->putImageData(toImageData(args.at(0)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), - args.at(3).toFloat(exec), args.at(4).toFloat(exec), args.at(5).toFloat(exec), args.at(6).toFloat(exec), ec); + if (exec->argumentCount() >= 7) + context->putImageData(toImageData(exec->argument(0)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), + exec->argument(3).toFloat(exec), exec->argument(4).toFloat(exec), exec->argument(5).toFloat(exec), exec->argument(6).toFloat(exec), ec); else - context->putImageData(toImageData(args.at(0)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec); + context->putImageData(toImageData(exec->argument(0)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), ec); setDOMException(exec, ec); return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::fillText(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::fillText(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); @@ -405,17 +405,17 @@ JSValue JSCanvasRenderingContext2D::fillText(ExecState* exec, const ArgList& arg // number arg = x // number arg = y // optional number arg = maxWidth - if (args.size() < 3 || args.size() > 4) + if (exec->argumentCount() < 3 || exec->argumentCount() > 4) return throwError(exec, SyntaxError); - if (args.size() == 4) - context->fillText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + if (exec->argumentCount() == 4) + context->fillText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); else - context->fillText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec)); + context->fillText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec)); return jsUndefined(); } -JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec, const ArgList& args) +JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec) { CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl()); @@ -423,13 +423,13 @@ JSValue JSCanvasRenderingContext2D::strokeText(ExecState* exec, const ArgList& a // number arg = x // number arg = y // optional number arg = maxWidth - if (args.size() < 3 || args.size() > 4) + if (exec->argumentCount() < 3 || exec->argumentCount() > 4) return throwError(exec, SyntaxError); - if (args.size() == 4) - context->strokeText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec)); + if (exec->argumentCount() == 4) + context->strokeText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec), exec->argument(3).toFloat(exec)); else - context->strokeText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec)); + context->strokeText(ustringToString(exec->argument(0).toString(exec)), exec->argument(1).toFloat(exec), exec->argument(2).toFloat(exec)); return jsUndefined(); } diff --git a/WebCore/bindings/js/JSClipboardCustom.cpp b/WebCore/bindings/js/JSClipboardCustom.cpp index ca06d92..ad5e055 100644 --- a/WebCore/bindings/js/JSClipboardCustom.cpp +++ b/WebCore/bindings/js/JSClipboardCustom.cpp @@ -63,17 +63,17 @@ JSValue JSClipboard::types(ExecState* exec) const return constructArray(exec, list); } -JSValue JSClipboard::clearData(ExecState* exec, const ArgList& args) +JSValue JSClipboard::clearData(ExecState* exec) { Clipboard* clipboard = impl(); - if (args.size() == 0) { + if (!exec->argumentCount()) { clipboard->clearAllData(); return jsUndefined(); } - if (args.size() == 1) { - clipboard->clearData(ustringToString(args.at(0).toString(exec))); + if (exec->argumentCount() == 1) { + clipboard->clearData(ustringToString(exec->argument(0).toString(exec))); return jsUndefined(); } @@ -81,23 +81,23 @@ JSValue JSClipboard::clearData(ExecState* exec, const ArgList& args) return throwError(exec, SyntaxError, "clearData: Invalid number of arguments"); } -JSValue JSClipboard::getData(ExecState* exec, const ArgList& args) +JSValue JSClipboard::getData(ExecState* exec) { // FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments. - if (args.size() != 1) + if (exec->argumentCount() != 1) return throwError(exec, SyntaxError, "getData: Invalid number of arguments"); Clipboard* clipboard = impl(); bool success; - String result = clipboard->getData(ustringToString(args.at(0).toString(exec)), success); + String result = clipboard->getData(ustringToString(exec->argument(0).toString(exec)), success); if (!success) return jsUndefined(); return jsString(exec, result); } -JSValue JSClipboard::setDragImage(ExecState* exec, const ArgList& args) +JSValue JSClipboard::setDragImage(ExecState* exec) { Clipboard* clipboard = impl(); @@ -105,14 +105,14 @@ JSValue JSClipboard::setDragImage(ExecState* exec, const ArgList& args) return jsUndefined(); // FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments. - if (args.size() != 3) + if (exec->argumentCount() != 3) return throwError(exec, SyntaxError, "setDragImage: Invalid number of arguments"); - int x = args.at(1).toInt32(exec); - int y = args.at(2).toInt32(exec); + int x = exec->argument(1).toInt32(exec); + int y = exec->argument(2).toInt32(exec); // See if they passed us a node - Node* node = toNode(args.at(0)); + Node* node = toNode(exec->argument(0)); if (!node) return throwError(exec, TypeError); diff --git a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp index b1f82a8..4d7b6e1 100644 --- a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp +++ b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp @@ -44,12 +44,12 @@ namespace WebCore { #if ENABLE(APPLICATION_CACHE_DYNAMIC_ENTRIES) -JSValue JSDOMApplicationCache::hasItem(ExecState* exec, const ArgList& args) +JSValue JSDOMApplicationCache::hasItem(ExecState* exec) { Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame(); if (!frame) return jsUndefined(); - const KURL& url = frame->loader()->completeURL(args.at(0).toString(exec)); + const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec)); ExceptionCode ec = 0; bool result = impl()->hasItem(url, ec); @@ -57,12 +57,12 @@ JSValue JSDOMApplicationCache::hasItem(ExecState* exec, const ArgList& args) return jsBoolean(result); } -JSValue JSDOMApplicationCache::add(ExecState* exec, const ArgList& args) +JSValue JSDOMApplicationCache::add(ExecState* exec) { Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame(); if (!frame) return jsUndefined(); - const KURL& url = frame->loader()->completeURL(args.at(0).toString(exec)); + const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec)); ExceptionCode ec = 0; impl()->add(url, ec); @@ -70,12 +70,12 @@ JSValue JSDOMApplicationCache::add(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSDOMApplicationCache::remove(ExecState* exec, const ArgList& args) +JSValue JSDOMApplicationCache::remove(ExecState* exec) { Frame* frame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame(); if (!frame) return jsUndefined(); - const KURL& url = frame->loader()->completeURL(args.at(0).toString(exec)); + const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec)); ExceptionCode ec = 0; impl()->remove(url, ec); diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h index 215e09a..3f2502d 100644 --- a/WebCore/bindings/js/JSDOMBinding.h +++ b/WebCore/bindings/js/JSDOMBinding.h @@ -222,7 +222,7 @@ namespace WebCore { { if (!node) return JSC::jsNull(); - if (JSNode* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node)) + if (JSC::JSCell* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node)) return wrapper; return createDOMNodeWrapper<WrapperClass>(exec, globalObject, node); } diff --git a/WebCore/bindings/js/JSDOMFormDataCustom.cpp b/WebCore/bindings/js/JSDOMFormDataCustom.cpp index 830db6b..f207578 100644 --- a/WebCore/bindings/js/JSDOMFormDataCustom.cpp +++ b/WebCore/bindings/js/JSDOMFormDataCustom.cpp @@ -39,11 +39,11 @@ using namespace JSC; namespace WebCore { -JSValue JSDOMFormData::append(ExecState* exec, const ArgList& args) +JSValue JSDOMFormData::append(ExecState* exec) { - if (args.size() >= 2) { - String name = ustringToString(args.at(0).toString(exec)); - JSValue value = args.at(1); + if (exec->argumentCount() >= 2) { + String name = ustringToString(exec->argument(0).toString(exec)); + JSValue value = exec->argument(1); if (value.inherits(&JSBlob::s_info)) impl()->append(name, toBlob(value)); else diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp index 343c8f9..eabf962 100644 --- a/WebCore/bindings/js/JSDOMWindowCustom.cpp +++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp @@ -766,11 +766,11 @@ static bool domWindowAllowPopUp(Frame* activeFrame, ExecState* exec) return DOMWindow::allowPopUp(activeFrame); } -JSValue JSDOMWindow::open(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::open(ExecState* exec) { - String urlString = valueToStringWithUndefinedOrNullCheck(exec, args.at(0)); - AtomicString frameName = args.at(1).isUndefinedOrNull() ? "_blank" : ustringToAtomicString(args.at(1).toString(exec)); - WindowFeatures windowFeatures(valueToStringWithUndefinedOrNullCheck(exec, args.at(2))); + String urlString = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)); + AtomicString frameName = exec->argument(1).isUndefinedOrNull() ? "_blank" : ustringToAtomicString(exec->argument(1).toString(exec)); + WindowFeatures windowFeatures(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2))); Frame* frame = impl()->frame(); if (!frame) @@ -840,11 +840,11 @@ JSValue JSDOMWindow::open(ExecState* exec, const ArgList& args) return toJS(exec, frame->domWindow()); } -JSValue JSDOMWindow::showModalDialog(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::showModalDialog(ExecState* exec) { - String url = valueToStringWithUndefinedOrNullCheck(exec, args.at(0)); - JSValue dialogArgs = args.at(1); - String featureArgs = valueToStringWithUndefinedOrNullCheck(exec, args.at(2)); + String url = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)); + JSValue dialogArgs = exec->argument(1); + String featureArgs = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2)); Frame* frame = impl()->frame(); if (!frame) @@ -923,23 +923,23 @@ JSValue JSDOMWindow::showModalDialog(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSDOMWindow::postMessage(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::postMessage(ExecState* exec) { DOMWindow* window = impl(); DOMWindow* source = asJSDOMWindow(exec->lexicalGlobalObject())->impl(); - PassRefPtr<SerializedScriptValue> message = SerializedScriptValue::create(exec, args.at(0)); + PassRefPtr<SerializedScriptValue> message = SerializedScriptValue::create(exec, exec->argument(0)); if (exec->hadException()) return jsUndefined(); MessagePortArray messagePorts; - if (args.size() > 2) - fillMessagePortArray(exec, args.at(1), messagePorts); + if (exec->argumentCount() > 2) + fillMessagePortArray(exec, exec->argument(1), messagePorts); if (exec->hadException()) return jsUndefined(); - String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, args.at((args.size() == 2) ? 1 : 2)); + String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, exec->argument((exec->argumentCount() == 2) ? 1 : 2)); if (exec->hadException()) return jsUndefined(); @@ -950,12 +950,12 @@ JSValue JSDOMWindow::postMessage(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSDOMWindow::setTimeout(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::setTimeout(ExecState* exec) { - OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, args, currentWorld(exec)); + OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec)); if (exec->hadException()) return jsUndefined(); - int delay = args.at(1).toInt32(exec); + int delay = exec->argument(1).toInt32(exec); ExceptionCode ec = 0; int result = impl()->setTimeout(action.release(), delay, ec); @@ -964,12 +964,12 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec, const ArgList& args) return jsNumber(exec, result); } -JSValue JSDOMWindow::setInterval(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::setInterval(ExecState* exec) { - OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, args, currentWorld(exec)); + OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec)); if (exec->hadException()) return jsUndefined(); - int delay = args.at(1).toInt32(exec); + int delay = exec->argument(1).toInt32(exec); ExceptionCode ec = 0; int result = impl()->setInterval(action.release(), delay, ec); @@ -978,67 +978,67 @@ JSValue JSDOMWindow::setInterval(ExecState* exec, const ArgList& args) return jsNumber(exec, result); } -JSValue JSDOMWindow::addEventListener(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::addEventListener(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame) return jsUndefined(); - JSValue listener = args.at(1); + JSValue listener = exec->argument(1); if (!listener.isObject()) return jsUndefined(); - impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec)); + impl()->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), exec->argument(2).toBoolean(exec)); return jsUndefined(); } -JSValue JSDOMWindow::removeEventListener(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::removeEventListener(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame) return jsUndefined(); - JSValue listener = args.at(1); + JSValue listener = exec->argument(1); if (!listener.isObject()) return jsUndefined(); - impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec)); + impl()->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec)); return jsUndefined(); } #if ENABLE(DATABASE) -JSValue JSDOMWindow::openDatabase(ExecState* exec, const ArgList& args) +JSValue JSDOMWindow::openDatabase(ExecState* exec) { - if (!allowsAccessFrom(exec) || (args.size() < 4)) { + if (!allowsAccessFrom(exec) || (exec->argumentCount() < 4)) { setDOMException(exec, SYNTAX_ERR); return jsUndefined(); } - String name = ustringToString(args.at(0).toString(exec)); + String name = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); - String version = ustringToString(args.at(1).toString(exec)); + String version = ustringToString(exec->argument(1).toString(exec)); if (exec->hadException()) return jsUndefined(); - String displayName = ustringToString(args.at(2).toString(exec)); + String displayName = ustringToString(exec->argument(2).toString(exec)); if (exec->hadException()) return jsUndefined(); - // args.at(3) = estimated size - unsigned long estimatedSize = args.at(3).toUInt32(exec); + // exec->argument(3) = estimated size + unsigned long estimatedSize = exec->argument(3).toUInt32(exec); if (exec->hadException()) return jsUndefined(); RefPtr<DatabaseCallback> creationCallback; - if (args.size() >= 5) { - if (!args.at(4).isObject()) { + if (exec->argumentCount() >= 5) { + if (!exec->argument(4).isObject()) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); } - creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject()); + creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject()); } ExceptionCode ec = 0; diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp index a86cc18..26f9db7 100644 --- a/WebCore/bindings/js/JSDatabaseCustom.cpp +++ b/WebCore/bindings/js/JSDatabaseCustom.cpp @@ -47,17 +47,17 @@ namespace WebCore { using namespace JSC; -JSValue JSDatabase::changeVersion(ExecState* exec, const ArgList& args) +JSValue JSDatabase::changeVersion(ExecState* exec) { - String oldVersion = ustringToString(args.at(0).toString(exec)); + String oldVersion = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); - String newVersion = ustringToString(args.at(1).toString(exec)); + String newVersion = ustringToString(exec->argument(1).toString(exec)); if (exec->hadException()) return jsUndefined(); - JSObject* object = args.at(2).getObject(); + JSObject* object = exec->argument(2).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -66,8 +66,8 @@ JSValue JSDatabase::changeVersion(ExecState* exec, const ArgList& args) RefPtr<SQLTransactionCallback> callback(JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()))); RefPtr<SQLTransactionErrorCallback> errorCallback; - if (!args.at(3).isNull()) { - object = args.at(3).getObject(); + if (!exec->argument(3).isNull()) { + object = exec->argument(3).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -77,8 +77,8 @@ JSValue JSDatabase::changeVersion(ExecState* exec, const ArgList& args) } RefPtr<VoidCallback> successCallback; - if (!args.at(4).isNull()) { - object = args.at(4).getObject(); + if (!exec->argument(4).isNull()) { + object = exec->argument(4).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -92,9 +92,9 @@ JSValue JSDatabase::changeVersion(ExecState* exec, const ArgList& args) return jsUndefined(); } -static JSValue createTransaction(ExecState* exec, const ArgList& args, Database* database, JSDOMGlobalObject* globalObject, bool readOnly) +static JSValue createTransaction(ExecState* exec, Database* database, JSDOMGlobalObject* globalObject, bool readOnly) { - JSObject* object = args.at(0).getObject(); + JSObject* object = exec->argument(0).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); @@ -103,8 +103,8 @@ static JSValue createTransaction(ExecState* exec, const ArgList& args, Database* RefPtr<SQLTransactionCallback> callback(JSSQLTransactionCallback::create(object, globalObject)); RefPtr<SQLTransactionErrorCallback> errorCallback; - if (args.size() > 1 && !args.at(1).isNull()) { - object = args.at(1).getObject(); + if (exec->argumentCount() > 1 && !exec->argument(1).isNull()) { + object = exec->argument(1).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -114,8 +114,8 @@ static JSValue createTransaction(ExecState* exec, const ArgList& args, Database* } RefPtr<VoidCallback> successCallback; - if (args.size() > 2 && !args.at(2).isNull()) { - object = args.at(2).getObject(); + if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) { + object = exec->argument(2).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -128,14 +128,14 @@ static JSValue createTransaction(ExecState* exec, const ArgList& args, Database* return jsUndefined(); } -JSValue JSDatabase::transaction(ExecState* exec, const ArgList& args) +JSValue JSDatabase::transaction(ExecState* exec) { - return createTransaction(exec, args, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false); + return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false); } -JSValue JSDatabase::readTransaction(ExecState* exec, const ArgList& args) +JSValue JSDatabase::readTransaction(ExecState* exec) { - return createTransaction(exec, args, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true); + return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true); } } diff --git a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp index 272cb83..79eb376 100644 --- a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp +++ b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp @@ -42,17 +42,17 @@ namespace WebCore { using namespace JSC; -JSValue JSDatabaseSync::changeVersion(ExecState* exec, const ArgList& args) +JSValue JSDatabaseSync::changeVersion(ExecState* exec) { - String oldVersion = ustringToString(args.at(0).toString(exec)); + String oldVersion = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); - String newVersion = ustringToString(args.at(1).toString(exec)); + String newVersion = ustringToString(exec->argument(1).toString(exec)); if (exec->hadException()) return jsUndefined(); - JSObject* object = args.at(2).getObject(); + JSObject* object = exec->argument(2).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -67,9 +67,9 @@ JSValue JSDatabaseSync::changeVersion(ExecState* exec, const ArgList& args) return jsUndefined(); } -static JSValue createTransaction(ExecState* exec, const ArgList& args, DatabaseSync* database, JSDOMGlobalObject* globalObject, bool readOnly) +static JSValue createTransaction(ExecState* exec, DatabaseSync* database, JSDOMGlobalObject* globalObject, bool readOnly) { - JSObject* object = args.at(0).getObject(); + JSObject* object = exec->argument(0).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -84,14 +84,14 @@ static JSValue createTransaction(ExecState* exec, const ArgList& args, DatabaseS return jsUndefined(); } -JSValue JSDatabaseSync::transaction(ExecState* exec, const ArgList& args) +JSValue JSDatabaseSync::transaction(ExecState* exec) { - return createTransaction(exec, args, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false); + return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false); } -JSValue JSDatabaseSync::readTransaction(ExecState* exec, const ArgList& args) +JSValue JSDatabaseSync::readTransaction(ExecState* exec) { - return createTransaction(exec, args, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true); + return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true); } } diff --git a/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp b/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp index fbee5ef..2222353 100644 --- a/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp +++ b/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp @@ -42,9 +42,9 @@ using namespace JSC; namespace WebCore { -JSC::JSValue JSDedicatedWorkerContext::postMessage(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSDedicatedWorkerContext::postMessage(JSC::ExecState* exec) { - return handlePostMessage(exec, args, impl()); + return handlePostMessage(exec, impl()); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp b/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp index 387f5f5..3098752 100644 --- a/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp +++ b/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp @@ -45,17 +45,17 @@ using namespace JSC; namespace WebCore { -JSValue JSNotificationCenter::requestPermission(ExecState* exec, const ArgList& args) +JSValue JSNotificationCenter::requestPermission(ExecState* exec) { // Permission request is only valid from page context. ScriptExecutionContext* context = impl()->context(); if (context->isWorkerContext()) return throwError(exec, SyntaxError); - if (!args.at(0).isObject()) + if (!exec->argument(0).isObject()) return throwError(exec, TypeError); - PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(args.at(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec)); + PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(exec->argument(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec)); impl()->requestPermission(callback); return jsUndefined(); diff --git a/WebCore/bindings/js/JSElementCustom.cpp b/WebCore/bindings/js/JSElementCustom.cpp index 7e294bd..23eda7e 100644 --- a/WebCore/bindings/js/JSElementCustom.cpp +++ b/WebCore/bindings/js/JSElementCustom.cpp @@ -64,73 +64,6 @@ void JSElement::markChildren(MarkStack& markStack) markDOMObjectWrapper(markStack, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl()); } -JSValue JSElement::setAttribute(ExecState* exec, const ArgList& args) -{ - ExceptionCode ec = 0; - AtomicString name = ustringToAtomicString(args.at(0).toString(exec)); - AtomicString value = ustringToAtomicString(args.at(1).toString(exec)); - - Element* imp = impl(); - if (!allowSettingSrcToJavascriptURL(exec, imp, name, value)) - return jsUndefined(); - - imp->setAttribute(name, value, ec); - setDOMException(exec, ec); - return jsUndefined(); -} - -JSValue JSElement::setAttributeNode(ExecState* exec, const ArgList& args) -{ - ExceptionCode ec = 0; - Attr* newAttr = toAttr(args.at(0)); - if (!newAttr) { - setDOMException(exec, TYPE_MISMATCH_ERR); - return jsUndefined(); - } - - Element* imp = impl(); - if (!allowSettingSrcToJavascriptURL(exec, imp, newAttr->name(), newAttr->value())) - return jsUndefined(); - - JSValue result = toJS(exec, globalObject(), WTF::getPtr(imp->setAttributeNode(newAttr, ec))); - setDOMException(exec, ec); - return result; -} - -JSValue JSElement::setAttributeNS(ExecState* exec, const ArgList& args) -{ - ExceptionCode ec = 0; - AtomicString namespaceURI = valueToStringWithNullCheck(exec, args.at(0)); - AtomicString qualifiedName = ustringToAtomicString(args.at(1).toString(exec)); - AtomicString value = ustringToAtomicString(args.at(2).toString(exec)); - - Element* imp = impl(); - if (!allowSettingSrcToJavascriptURL(exec, imp, qualifiedName, value)) - return jsUndefined(); - - imp->setAttributeNS(namespaceURI, qualifiedName, value, ec); - setDOMException(exec, ec); - return jsUndefined(); -} - -JSValue JSElement::setAttributeNodeNS(ExecState* exec, const ArgList& args) -{ - ExceptionCode ec = 0; - Attr* newAttr = toAttr(args.at(0)); - if (!newAttr) { - setDOMException(exec, TYPE_MISMATCH_ERR); - return jsUndefined(); - } - - Element* imp = impl(); - if (!allowSettingSrcToJavascriptURL(exec, imp, newAttr->name(), newAttr->value())) - return jsUndefined(); - - JSValue result = toJS(exec, globalObject(), WTF::getPtr(imp->setAttributeNodeNS(newAttr, ec))); - setDOMException(exec, ec); - return result; -} - JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Element* element) { if (!element) diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp index bc69323..b6190ff 100644 --- a/WebCore/bindings/js/JSEventCustom.cpp +++ b/WebCore/bindings/js/JSEventCustom.cpp @@ -40,10 +40,6 @@ #include "JSCompositionEvent.h" #include "JSDeviceOrientationEvent.h" #include "JSErrorEvent.h" -#if ENABLE(INDEXED_DATABASE) -#include "JSIDBErrorEvent.h" -#include "JSIDBSuccessEvent.h" -#endif #include "JSKeyboardEvent.h" #include "JSMessageEvent.h" #include "JSMouseEvent.h" @@ -60,10 +56,6 @@ #include "JSXMLHttpRequestProgressEvent.h" #include "BeforeLoadEvent.h" #include "ErrorEvent.h" -#if ENABLE(INDEXED_DATABASE) -#include "IDBErrorEvent.h" -#include "IDBSuccessEvent.h" -#endif #include "KeyboardEvent.h" #include "MessageEvent.h" #include "MouseEvent.h" @@ -95,6 +87,13 @@ #include "TouchEvent.h" #endif +#if ENABLE(INDEXED_DATABASE) +#include "IDBErrorEvent.h" +#include "IDBSuccessEvent.h" +#include "JSIDBErrorEvent.h" +#include "JSIDBSuccessEvent.h" +#endif + using namespace JSC; namespace WebCore { diff --git a/WebCore/bindings/js/JSFloatArrayCustom.cpp b/WebCore/bindings/js/JSFloatArrayCustom.cpp index 9e52762..8a82f98 100644 --- a/WebCore/bindings/js/JSFloatArrayCustom.cpp +++ b/WebCore/bindings/js/JSFloatArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, FloatAr return getDOMObjectWrapper<JSFloatArray>(exec, globalObject, object); } -JSC::JSValue JSFloatArray::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSFloatArray::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toFloatArray); + return setWebGLArrayHelper(exec, impl(), toFloatArray); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSGeolocationCustom.cpp b/WebCore/bindings/js/JSGeolocationCustom.cpp index 8bc348c..16849ec 100644 --- a/WebCore/bindings/js/JSGeolocationCustom.cpp +++ b/WebCore/bindings/js/JSGeolocationCustom.cpp @@ -135,20 +135,20 @@ static PassRefPtr<PositionOptions> createPositionOptions(ExecState* exec, JSValu return options.release(); } -JSValue JSGeolocation::getCurrentPosition(ExecState* exec, const ArgList& args) +JSValue JSGeolocation::getCurrentPosition(ExecState* exec) { // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions - RefPtr<PositionCallback> positionCallback = createPositionCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), args.at(0)); + RefPtr<PositionCallback> positionCallback = createPositionCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0)); if (exec->hadException()) return jsUndefined(); ASSERT(positionCallback); - RefPtr<PositionErrorCallback> positionErrorCallback = createPositionErrorCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), args.at(1)); + RefPtr<PositionErrorCallback> positionErrorCallback = createPositionErrorCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1)); if (exec->hadException()) return jsUndefined(); - RefPtr<PositionOptions> positionOptions = createPositionOptions(exec, args.at(2)); + RefPtr<PositionOptions> positionOptions = createPositionOptions(exec, exec->argument(2)); if (exec->hadException()) return jsUndefined(); ASSERT(positionOptions); @@ -157,20 +157,20 @@ JSValue JSGeolocation::getCurrentPosition(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSGeolocation::watchPosition(ExecState* exec, const ArgList& args) +JSValue JSGeolocation::watchPosition(ExecState* exec) { // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions - RefPtr<PositionCallback> positionCallback = createPositionCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), args.at(0)); + RefPtr<PositionCallback> positionCallback = createPositionCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0)); if (exec->hadException()) return jsUndefined(); ASSERT(positionCallback); - RefPtr<PositionErrorCallback> positionErrorCallback = createPositionErrorCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), args.at(1)); + RefPtr<PositionErrorCallback> positionErrorCallback = createPositionErrorCallback(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1)); if (exec->hadException()) return jsUndefined(); - RefPtr<PositionOptions> positionOptions = createPositionOptions(exec, args.at(2)); + RefPtr<PositionOptions> positionOptions = createPositionOptions(exec, exec->argument(2)); if (exec->hadException()) return jsUndefined(); ASSERT(positionOptions); diff --git a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp index 86d6fa2..3d819ef 100644 --- a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp +++ b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp @@ -58,21 +58,21 @@ static JSValue getNamedItems(ExecState* exec, JSHTMLAllCollection* collection, c // HTMLCollections are strange objects, they support both get and call, // so that document.forms.item(0) and document.forms(0) both work. -static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) +static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case. - JSHTMLAllCollection* jsCollection = static_cast<JSHTMLAllCollection*>(function); + JSHTMLAllCollection* jsCollection = static_cast<JSHTMLAllCollection*>(exec->callee()); HTMLAllCollection* collection = static_cast<HTMLAllCollection*>(jsCollection->impl()); // Also, do we need the TypeError test here ? - if (args.size() == 1) { + if (exec->argumentCount() == 1) { // Support for document.all(<index>) etc. bool ok; - UString string = args.at(0).toString(exec); + UString string = exec->argument(0).toString(exec); unsigned index = string.toUInt32(&ok, false); if (ok) return toJS(exec, jsCollection->globalObject(), collection->item(index)); @@ -83,8 +83,8 @@ static JSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec, JSObject* fu // The second arg, if set, is the index of the item we want bool ok; - UString string = args.at(0).toString(exec); - unsigned index = args.at(1).toString(exec).toUInt32(&ok, false); + UString string = exec->argument(0).toString(exec); + unsigned index = exec->argument(1).toString(exec).toUInt32(&ok, false); if (ok) { String pstr = ustringToString(string); Node* node = collection->namedItem(pstr); @@ -118,18 +118,18 @@ JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, JSValue slotBase, const return getNamedItems(exec, thisObj, propertyName); } -JSValue JSHTMLAllCollection::item(ExecState* exec, const ArgList& args) +JSValue JSHTMLAllCollection::item(ExecState* exec) { bool ok; - uint32_t index = args.at(0).toString(exec).toUInt32(&ok, false); + uint32_t index = exec->argument(0).toString(exec).toUInt32(&ok, false); if (ok) return toJS(exec, globalObject(), impl()->item(index)); - return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); + return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec))); } -JSValue JSHTMLAllCollection::namedItem(ExecState* exec, const ArgList& args) +JSValue JSHTMLAllCollection::namedItem(ExecState* exec) { - return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); + return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec))); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp b/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp index 419f9e9..a69696a 100644 --- a/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,17 +50,17 @@ void JSHTMLCanvasElement::markChildren(MarkStack& markStack) markDOMObjectWrapper(markStack, globalData, canvas->renderingContext()); } -JSValue JSHTMLCanvasElement::getContext(ExecState* exec, const ArgList& args) +JSValue JSHTMLCanvasElement::getContext(ExecState* exec) { HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl()); - const UString& contextId = args.at(0).toString(exec); + const UString& contextId = exec->argument(0).toString(exec); RefPtr<CanvasContextAttributes> attrs; #if ENABLE(3D_CANVAS) if (contextId == "experimental-webgl" || contextId == "webkit-3d") { attrs = WebGLContextAttributes::create(); WebGLContextAttributes* webGLAttrs = static_cast<WebGLContextAttributes*>(attrs.get()); - if (args.size() > 1 && args.at(1).isObject()) { - JSObject* jsAttrs = args.at(1).getObject(); + if (exec->argumentCount() > 1 && exec->argument(1).isObject()) { + JSObject* jsAttrs = exec->argument(1).getObject(); Identifier alpha(exec, "alpha"); if (jsAttrs->hasProperty(exec, alpha)) webGLAttrs->setAlpha(jsAttrs->get(exec, alpha).toBoolean(exec)); @@ -84,4 +85,22 @@ JSValue JSHTMLCanvasElement::getContext(ExecState* exec, const ArgList& args) return toJS(exec, globalObject(), WTF::getPtr(context)); } +JSValue JSHTMLCanvasElement::toDataURL(ExecState* exec) +{ + const String& type = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)); + double quality = 1.0; + if (exec->argumentCount() > 1) { + JSValue v = exec->argument(1); + if (v.isNumber()) + quality = v.toNumber(exec); + if (!(0.0 <= quality && quality <= 1.0)) + quality = 1.0; + } + HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl()); + ExceptionCode ec = 0; + JSC::JSValue result = jsString(exec, canvas->toDataURL(type, quality, ec)); + setDOMException(exec, ec); + return result; +} + } // namespace WebCore diff --git a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp index c5eb41a..24059b7 100644 --- a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp +++ b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp @@ -55,21 +55,21 @@ static JSValue getNamedItems(ExecState* exec, JSHTMLCollection* collection, cons // HTMLCollections are strange objects, they support both get and call, // so that document.forms.item(0) and document.forms(0) both work. -static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args) +static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case. - JSHTMLCollection* jsCollection = static_cast<JSHTMLCollection*>(function); + JSHTMLCollection* jsCollection = static_cast<JSHTMLCollection*>(exec->callee()); HTMLCollection* collection = jsCollection->impl(); // Also, do we need the TypeError test here ? - if (args.size() == 1) { + if (exec->argumentCount() == 1) { // Support for document.all(<index>) etc. bool ok; - UString string = args.at(0).toString(exec); + UString string = exec->argument(0).toString(exec); unsigned index = string.toUInt32(&ok, false); if (ok) return toJS(exec, jsCollection->globalObject(), collection->item(index)); @@ -80,8 +80,8 @@ static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* funct // The second arg, if set, is the index of the item we want bool ok; - UString string = args.at(0).toString(exec); - unsigned index = args.at(1).toString(exec).toUInt32(&ok, false); + UString string = exec->argument(0).toString(exec); + unsigned index = exec->argument(1).toString(exec).toUInt32(&ok, false); if (ok) { String pstr = ustringToString(string); Node* node = collection->namedItem(pstr); @@ -115,18 +115,18 @@ JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, const Id return getNamedItems(exec, thisObj, propertyName); } -JSValue JSHTMLCollection::item(ExecState* exec, const ArgList& args) +JSValue JSHTMLCollection::item(ExecState* exec) { bool ok; - uint32_t index = args.at(0).toString(exec).toUInt32(&ok, false); + uint32_t index = exec->argument(0).toString(exec).toUInt32(&ok, false); if (ok) return toJS(exec, globalObject(), impl()->item(index)); - return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); + return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec))); } -JSValue JSHTMLCollection::namedItem(ExecState* exec, const ArgList& args) +JSValue JSHTMLCollection::namedItem(ExecState* exec) { - return getNamedItems(exec, this, Identifier(exec, args.at(0).toString(exec))); + return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec))); } JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, HTMLCollection* collection) diff --git a/WebCore/bindings/js/JSHTMLDocumentCustom.cpp b/WebCore/bindings/js/JSHTMLDocumentCustom.cpp index de0e96f..30cb3a2 100644 --- a/WebCore/bindings/js/JSHTMLDocumentCustom.cpp +++ b/WebCore/bindings/js/JSHTMLDocumentCustom.cpp @@ -100,10 +100,10 @@ void JSHTMLDocument::setAll(ExecState* exec, JSValue value) // Custom functions -JSValue JSHTMLDocument::open(ExecState* exec, const ArgList& args) +JSValue JSHTMLDocument::open(ExecState* exec) { // For compatibility with other browsers, pass open calls with more than 2 parameters to the window. - if (args.size() > 2) { + if (exec->argumentCount() > 2) { Frame* frame = static_cast<HTMLDocument*>(impl())->frame(); if (frame) { JSDOMWindowShell* wrapper = toJSDOMWindowShell(frame, currentWorld(exec)); @@ -113,7 +113,7 @@ JSValue JSHTMLDocument::open(ExecState* exec, const ArgList& args) CallType callType = function.getCallData(callData); if (callType == CallTypeNone) return throwError(exec, TypeError); - return JSC::call(exec, function, callType, callData, wrapper, args); + return JSC::call(exec, function, callType, callData, wrapper, ArgList(exec)); } } return jsUndefined(); @@ -130,20 +130,20 @@ JSValue JSHTMLDocument::open(ExecState* exec, const ArgList& args) enum NewlineRequirement { DoNotAddNewline, DoAddNewline }; -static inline void documentWrite(ExecState* exec, const ArgList& args, HTMLDocument* document, NewlineRequirement addNewline) +static inline void documentWrite(ExecState* exec, HTMLDocument* document, NewlineRequirement addNewline) { // DOM only specifies single string argument, but browsers allow multiple or no arguments. - size_t size = args.size(); + size_t size = exec->argumentCount(); - UString firstString = args.at(0).toString(exec); + UString firstString = exec->argument(0).toString(exec); SegmentedString segmentedString = ustringToString(firstString); if (size != 1) { if (!size) segmentedString.clear(); else { for (size_t i = 1; i < size; ++i) { - UString subsequentString = args.at(i).toString(exec); + UString subsequentString = exec->argument(i).toString(exec); segmentedString.append(SegmentedString(ustringToString(subsequentString))); } } @@ -155,15 +155,15 @@ static inline void documentWrite(ExecState* exec, const ArgList& args, HTMLDocum document->write(segmentedString, activeDocument); } -JSValue JSHTMLDocument::write(ExecState* exec, const ArgList& args) +JSValue JSHTMLDocument::write(ExecState* exec) { - documentWrite(exec, args, static_cast<HTMLDocument*>(impl()), DoNotAddNewline); + documentWrite(exec, static_cast<HTMLDocument*>(impl()), DoNotAddNewline); return jsUndefined(); } -JSValue JSHTMLDocument::writeln(ExecState* exec, const ArgList& args) +JSValue JSHTMLDocument::writeln(ExecState* exec) { - documentWrite(exec, args, static_cast<HTMLDocument*>(impl()), DoAddNewline); + documentWrite(exec, static_cast<HTMLDocument*>(impl()), DoAddNewline); return jsUndefined(); } diff --git a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp index e5166ee..d4be8dc 100644 --- a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp @@ -103,14 +103,14 @@ void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value) input->setSelectionEnd(value.toInt32(exec)); } -JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec, const ArgList& args) +JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec) { HTMLInputElement* input = static_cast<HTMLInputElement*>(impl()); if (!input->canHaveSelection()) return throwError(exec, TypeError); - int start = args.at(0).toInt32(exec); - int end = args.at(1).toInt32(exec); + int start = exec->argument(0).toInt32(exec); + int end = exec->argument(1).toInt32(exec); input->setSelectionRange(start, end); return jsUndefined(); diff --git a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp index 7bca2db..dc2f7cb 100644 --- a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp +++ b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp @@ -67,16 +67,16 @@ void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSVal selectIndexSetter(base, exec, index, value); } -JSValue JSHTMLOptionsCollection::add(ExecState* exec, const ArgList& args) +JSValue JSHTMLOptionsCollection::add(ExecState* exec) { HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl()); - HTMLOptionElement* option = toHTMLOptionElement(args.at(0)); + HTMLOptionElement* option = toHTMLOptionElement(exec->argument(0)); ExceptionCode ec = 0; - if (args.size() < 2) + if (exec->argumentCount() < 2) imp->add(option, ec); else { bool ok; - int index = args.at(1).toInt32(exec, ok); + int index = exec->argument(1).toInt32(exec, ok); if (exec->hadException()) return jsUndefined(); if (!ok) @@ -88,11 +88,11 @@ JSValue JSHTMLOptionsCollection::add(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSHTMLOptionsCollection::remove(ExecState* exec, const ArgList& args) +JSValue JSHTMLOptionsCollection::remove(ExecState* exec) { HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl()); JSHTMLSelectElement* base = static_cast<JSHTMLSelectElement*>(asObject(toJS(exec, globalObject(), imp->base()))); - return base->remove(exec, args); + return base->remove(exec); } } diff --git a/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp b/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp index 9bb6b75..5c462c1 100644 --- a/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp +++ b/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp @@ -32,16 +32,16 @@ namespace WebCore { using namespace JSC; using namespace HTMLNames; -JSValue JSHTMLSelectElement::remove(ExecState* exec, const ArgList& args) +JSValue JSHTMLSelectElement::remove(ExecState* exec) { HTMLSelectElement& select = *static_cast<HTMLSelectElement*>(impl()); // we support both options index and options objects - HTMLElement* element = toHTMLElement(args.at(0)); + HTMLElement* element = toHTMLElement(exec->argument(0)); if (element && element->hasTagName(optionTag)) select.remove(static_cast<HTMLOptionElement*>(element)->index()); else - select.remove(args.at(0).toInt32(exec)); + select.remove(exec->argument(0).toInt32(exec)); return jsUndefined(); } diff --git a/WebCore/bindings/js/JSHistoryCustom.cpp b/WebCore/bindings/js/JSHistoryCustom.cpp index 53b554f..6a2f614 100644 --- a/WebCore/bindings/js/JSHistoryCustom.cpp +++ b/WebCore/bindings/js/JSHistoryCustom.cpp @@ -162,19 +162,19 @@ void JSHistory::getOwnPropertyNames(ExecState* exec, PropertyNameArray& property Base::getOwnPropertyNames(exec, propertyNames, mode); } -JSValue JSHistory::pushState(ExecState* exec, const ArgList& args) +JSValue JSHistory::pushState(ExecState* exec) { - RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(exec, args.at(0)); + RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(exec, exec->argument(0)); if (exec->hadException()) return jsUndefined(); - String title = valueToStringWithUndefinedOrNullCheck(exec, args.at(1)); + String title = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(1)); if (exec->hadException()) return jsUndefined(); String url; - if (args.size() > 2) { - url = valueToStringWithUndefinedOrNullCheck(exec, args.at(2)); + if (exec->argumentCount() > 2) { + url = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2)); if (exec->hadException()) return jsUndefined(); } @@ -186,19 +186,19 @@ JSValue JSHistory::pushState(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSHistory::replaceState(ExecState* exec, const ArgList& args) +JSValue JSHistory::replaceState(ExecState* exec) { - RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(exec, args.at(0)); + RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(exec, exec->argument(0)); if (exec->hadException()) return jsUndefined(); - String title = valueToStringWithUndefinedOrNullCheck(exec, args.at(1)); + String title = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(1)); if (exec->hadException()) return jsUndefined(); String url; - if (args.size() > 2) { - url = valueToStringWithUndefinedOrNullCheck(exec, args.at(2)); + if (exec->argumentCount() > 2) { + url = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2)); if (exec->hadException()) return jsUndefined(); } diff --git a/WebCore/bindings/js/JSIDBAnyCustom.cpp b/WebCore/bindings/js/JSIDBAnyCustom.cpp index f7674b8..43a79a2 100644 --- a/WebCore/bindings/js/JSIDBAnyCustom.cpp +++ b/WebCore/bindings/js/JSIDBAnyCustom.cpp @@ -36,8 +36,12 @@ #include "IDBAny.h" #include "IDBDatabaseRequest.h" +#include "IDBIndexRequest.h" +#include "IDBObjectStoreRequest.h" #include "IndexedDatabaseRequest.h" #include "JSIDBDatabaseRequest.h" +#include "JSIDBIndexRequest.h" +#include "JSIDBObjectStoreRequest.h" #include "JSIndexedDatabaseRequest.h" #include "SerializedScriptValue.h" @@ -53,8 +57,14 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBAny* idbAny) switch (idbAny->type()) { case IDBAny::UndefinedType: return jsUndefined(); + case IDBAny::NullType: + return jsNull(); case IDBAny::IDBDatabaseRequestType: return toJS(exec, globalObject, idbAny->idbDatabaseRequest()); + case IDBAny::IDBIndexRequestType: + return toJS(exec, globalObject, idbAny->idbIndexRequest()); + case IDBAny::IDBObjectStoreRequestType: + return toJS(exec, globalObject, idbAny->idbObjectStoreRequest()); case IDBAny::IndexedDatabaseRequestType: return toJS(exec, globalObject, idbAny->indexedDatabaseRequest()); case IDBAny::SerializedScriptValueType: diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp index df191b7..c13ea0c 100644 --- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp +++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp @@ -104,16 +104,16 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri } #if ENABLE(DATABASE) -JSValue JSInjectedScriptHost::databaseForId(ExecState* exec, const ArgList& args) +JSValue JSInjectedScriptHost::databaseForId(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); InspectorController* ic = impl()->inspectorController(); if (!ic) return jsUndefined(); - Database* database = impl()->databaseForId(args.at(0).toInt32(exec)); + Database* database = impl()->databaseForId(exec->argument(0).toInt32(exec)); if (!database) return jsUndefined(); return toJS(exec, database); @@ -121,7 +121,7 @@ JSValue JSInjectedScriptHost::databaseForId(ExecState* exec, const ArgList& args #endif #if ENABLE(JAVASCRIPT_DEBUGGER) -JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec, const ArgList&) +JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec) { JavaScriptCallFrame* callFrame = ScriptDebugServer::shared().currentCallFrame(); if (!callFrame || !callFrame->isValid()) @@ -132,12 +132,12 @@ JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec, const ArgList&) } #endif -JSValue JSInjectedScriptHost::nodeForId(ExecState* exec, const ArgList& args) +JSValue JSInjectedScriptHost::nodeForId(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); - Node* node = impl()->nodeForId(args.at(0).toInt32(exec)); + Node* node = impl()->nodeForId(exec->argument(0).toInt32(exec)); if (!node) return jsUndefined(); @@ -149,27 +149,27 @@ JSValue JSInjectedScriptHost::nodeForId(ExecState* exec, const ArgList& args) return toJS(exec, node); } -JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec, const ArgList& args) +JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec) { - if (args.size() < 3) + if (exec->argumentCount() < 3) return jsUndefined(); - Node* node = toNode(args.at(0)); + Node* node = toNode(exec->argument(0)); if (!node) return jsUndefined(); - bool withChildren = args.at(1).toBoolean(exec); - bool selectInUI = args.at(2).toBoolean(exec); + bool withChildren = exec->argument(1).toBoolean(exec); + bool selectInUI = exec->argument(2).toBoolean(exec); return jsNumber(exec, impl()->pushNodePathToFrontend(node, withChildren, selectInUI)); } #if ENABLE(DATABASE) -JSValue JSInjectedScriptHost::selectDatabase(ExecState*, const ArgList& args) +JSValue JSInjectedScriptHost::selectDatabase(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); - Database* database = toDatabase(args.at(0)); + Database* database = toDatabase(exec->argument(0)); if (database) impl()->selectDatabase(database); return jsUndefined(); @@ -177,34 +177,34 @@ JSValue JSInjectedScriptHost::selectDatabase(ExecState*, const ArgList& args) #endif #if ENABLE(DOM_STORAGE) -JSValue JSInjectedScriptHost::selectDOMStorage(ExecState*, const ArgList& args) +JSValue JSInjectedScriptHost::selectDOMStorage(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return jsUndefined(); InspectorController* ic = impl()->inspectorController(); if (!ic) return jsUndefined(); - Storage* storage = toStorage(args.at(0)); + Storage* storage = toStorage(exec->argument(0)); if (storage) impl()->selectDOMStorage(storage); return jsUndefined(); } #endif -JSValue JSInjectedScriptHost::reportDidDispatchOnInjectedScript(ExecState* exec, const ArgList& args) +JSValue JSInjectedScriptHost::reportDidDispatchOnInjectedScript(ExecState* exec) { - if (args.size() < 3) + if (exec->argumentCount() < 3) return jsUndefined(); - if (!args.at(0).isInt32()) + if (!exec->argument(0).isInt32()) return jsUndefined(); - int callId = args.at(0).asInt32(); + int callId = exec->argument(0).asInt32(); - RefPtr<SerializedScriptValue> result(SerializedScriptValue::create(exec, args.at(1))); + RefPtr<SerializedScriptValue> result(SerializedScriptValue::create(exec, exec->argument(1))); bool isException; - if (!args.at(2).getBoolean(isException)) + if (!exec->argument(2).getBoolean(isException)) return jsUndefined(); impl()->reportDidDispatchOnInjectedScript(callId, result.get(), isException); return jsUndefined(); diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp index d18260b..c119adf 100644 --- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp +++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp @@ -49,7 +49,7 @@ using namespace JSC; namespace WebCore { -JSValue JSInspectorFrontendHost::platform(ExecState* execState, const ArgList&) +JSValue JSInspectorFrontendHost::platform(ExecState* execState) { #if PLATFORM(MAC) DEFINE_STATIC_LOCAL(const String, platform, ("mac")); @@ -63,7 +63,7 @@ JSValue JSInspectorFrontendHost::platform(ExecState* execState, const ArgList&) return jsString(execState, platform); } -JSValue JSInspectorFrontendHost::port(ExecState* execState, const ArgList&) +JSValue JSInspectorFrontendHost::port(ExecState* execState) { #if PLATFORM(QT) DEFINE_STATIC_LOCAL(const String, port, ("qt")); @@ -77,31 +77,29 @@ JSValue JSInspectorFrontendHost::port(ExecState* execState, const ArgList&) return jsString(execState, port); } -JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const ArgList& args) +JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec) { - if (args.size() < 2) + if (exec->argumentCount() < 2) return jsUndefined(); #if ENABLE(CONTEXT_MENUS) - Event* event = toEvent(args.at(0)); + Event* event = toEvent(exec->argument(0)); - JSArray* array = asArray(args.at(1)); + JSArray* array = asArray(exec->argument(1)); Vector<ContextMenuItem*> items; for (size_t i = 0; i < array->length(); ++i) { JSObject* item = asObject(array->getIndex(i)); - JSValue label = item->get(execState, Identifier(execState, "label")); - JSValue id = item->get(execState, Identifier(execState, "id")); + JSValue label = item->get(exec, Identifier(exec, "label")); + JSValue id = item->get(exec, Identifier(exec, "id")); if (label.isUndefined() || id.isUndefined()) items.append(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String())); else { - ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(execState)); - items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(execState)))); + ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec)); + items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(exec)))); } } impl()->showContextMenu(event, items); -#else - UNUSED_PARAM(execState); #endif return jsUndefined(); } diff --git a/WebCore/bindings/js/JSInt16ArrayCustom.cpp b/WebCore/bindings/js/JSInt16ArrayCustom.cpp index d557c3d..2888a1b 100644 --- a/WebCore/bindings/js/JSInt16ArrayCustom.cpp +++ b/WebCore/bindings/js/JSInt16ArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Int16Ar return getDOMObjectWrapper<JSInt16Array>(exec, globalObject, object); } -JSC::JSValue JSInt16Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSInt16Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toInt16Array); + return setWebGLArrayHelper(exec, impl(), toInt16Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSInt32ArrayCustom.cpp b/WebCore/bindings/js/JSInt32ArrayCustom.cpp index 3d0ca79..cfdab63 100644 --- a/WebCore/bindings/js/JSInt32ArrayCustom.cpp +++ b/WebCore/bindings/js/JSInt32ArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Int32Ar return getDOMObjectWrapper<JSInt32Array>(exec, globalObject, object); } -JSC::JSValue JSInt32Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSInt32Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toInt32Array); + return setWebGLArrayHelper(exec, impl(), toInt32Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSInt8ArrayCustom.cpp b/WebCore/bindings/js/JSInt8ArrayCustom.cpp index 3c94002..9d41694 100644 --- a/WebCore/bindings/js/JSInt8ArrayCustom.cpp +++ b/WebCore/bindings/js/JSInt8ArrayCustom.cpp @@ -48,9 +48,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Int8Arr return getDOMObjectWrapper<JSInt8Array>(exec, globalObject, object); } -JSC::JSValue JSInt8Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSInt8Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toInt8Array); + return setWebGLArrayHelper(exec, impl(), toInt8Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp b/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp index f45abf6..6c04930 100644 --- a/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp +++ b/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp @@ -35,10 +35,10 @@ using namespace JSC; namespace WebCore { -JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec, const ArgList& args) +JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec) { JSValue exception; - JSValue result = impl()->evaluate(args.at(0).toString(exec), exception); + JSValue result = impl()->evaluate(exec->argument(0).toString(exec), exception); if (exception) exec->setException(exception); @@ -85,14 +85,14 @@ JSValue JSJavaScriptCallFrame::scopeChain(ExecState* exec) const return constructArray(exec, list); } -JSValue JSJavaScriptCallFrame::scopeType(ExecState* exec, const ArgList& args) +JSValue JSJavaScriptCallFrame::scopeType(ExecState* exec) { if (!impl()->scopeChain()) return jsUndefined(); - if (!args.at(0).isInt32()) + if (!exec->argument(0).isInt32()) return jsUndefined(); - int index = args.at(0).asInt32(); + int index = exec->argument(0).asInt32(); const ScopeChainNode* scopeChain = impl()->scopeChain(); ScopeChainIterator end = scopeChain->end(); diff --git a/WebCore/bindings/js/JSLocationCustom.cpp b/WebCore/bindings/js/JSLocationCustom.cpp index da35c23..76005fa 100644 --- a/WebCore/bindings/js/JSLocationCustom.cpp +++ b/WebCore/bindings/js/JSLocationCustom.cpp @@ -301,13 +301,13 @@ void JSLocation::setHash(ExecState* exec, JSValue value) navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false); } -JSValue JSLocation::replace(ExecState* exec, const ArgList& args) +JSValue JSLocation::replace(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame) return jsUndefined(); - KURL url = completeURL(exec, ustringToString(args.at(0).toString(exec))); + KURL url = completeURL(exec, ustringToString(exec->argument(0).toString(exec))); if (url.isNull()) return jsUndefined(); @@ -318,7 +318,7 @@ JSValue JSLocation::replace(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSLocation::reload(ExecState* exec, const ArgList&) +JSValue JSLocation::reload(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame || !allowsAccessFromFrame(exec, frame)) @@ -329,13 +329,13 @@ JSValue JSLocation::reload(ExecState* exec, const ArgList&) return jsUndefined(); } -JSValue JSLocation::assign(ExecState* exec, const ArgList& args) +JSValue JSLocation::assign(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame) return jsUndefined(); - KURL url = completeURL(exec, ustringToString(args.at(0).toString(exec))); + KURL url = completeURL(exec, ustringToString(exec->argument(0).toString(exec))); if (url.isNull()) return jsUndefined(); @@ -347,7 +347,7 @@ JSValue JSLocation::assign(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSLocation::toString(ExecState* exec, const ArgList&) +JSValue JSLocation::toString(ExecState* exec) { Frame* frame = impl()->frame(); if (!frame || !allowsAccessFromFrame(exec, frame)) diff --git a/WebCore/bindings/js/JSMessageEventCustom.cpp b/WebCore/bindings/js/JSMessageEventCustom.cpp index fc1f542..b3dabae 100644 --- a/WebCore/bindings/js/JSMessageEventCustom.cpp +++ b/WebCore/bindings/js/JSMessageEventCustom.cpp @@ -54,19 +54,19 @@ JSValue JSMessageEvent::ports(ExecState* exec) const return constructArray(exec, list); } -JSC::JSValue JSMessageEvent::initMessageEvent(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSMessageEvent::initMessageEvent(JSC::ExecState* exec) { - const UString& typeArg = args.at(0).toString(exec); - bool canBubbleArg = args.at(1).toBoolean(exec); - bool cancelableArg = args.at(2).toBoolean(exec); - PassRefPtr<SerializedScriptValue> dataArg = SerializedScriptValue::create(exec, args.at(3)); - const UString& originArg = args.at(4).toString(exec); - const UString& lastEventIdArg = args.at(5).toString(exec); - DOMWindow* sourceArg = toDOMWindow(args.at(6)); + const UString& typeArg = exec->argument(0).toString(exec); + bool canBubbleArg = exec->argument(1).toBoolean(exec); + bool cancelableArg = exec->argument(2).toBoolean(exec); + PassRefPtr<SerializedScriptValue> dataArg = SerializedScriptValue::create(exec, exec->argument(3)); + const UString& originArg = exec->argument(4).toString(exec); + const UString& lastEventIdArg = exec->argument(5).toString(exec); + DOMWindow* sourceArg = toDOMWindow(exec->argument(6)); OwnPtr<MessagePortArray> messagePorts; - if (!args.at(7).isUndefinedOrNull()) { + if (!exec->argument(7).isUndefinedOrNull()) { messagePorts = new MessagePortArray(); - fillMessagePortArray(exec, args.at(7), *messagePorts); + fillMessagePortArray(exec, exec->argument(7), *messagePorts); if (exec->hadException()) return jsUndefined(); } diff --git a/WebCore/bindings/js/JSMessagePortCustom.cpp b/WebCore/bindings/js/JSMessagePortCustom.cpp index 4c1491d..79c1811 100644 --- a/WebCore/bindings/js/JSMessagePortCustom.cpp +++ b/WebCore/bindings/js/JSMessagePortCustom.cpp @@ -52,9 +52,9 @@ void JSMessagePort::markChildren(MarkStack& markStack) m_impl->markJSEventListeners(markStack); } -JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec) { - return handlePostMessage(exec, args, impl()); + return handlePostMessage(exec, impl()); } void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortArray& portArray) diff --git a/WebCore/bindings/js/JSMessagePortCustom.h b/WebCore/bindings/js/JSMessagePortCustom.h index 17b1eae..62ebef1 100644 --- a/WebCore/bindings/js/JSMessagePortCustom.h +++ b/WebCore/bindings/js/JSMessagePortCustom.h @@ -47,11 +47,11 @@ namespace WebCore { // Helper function to convert from JS postMessage arguments to WebCore postMessage arguments. template <typename T> - inline JSC::JSValue handlePostMessage(JSC::ExecState* exec, const JSC::ArgList& args, T* impl) + inline JSC::JSValue handlePostMessage(JSC::ExecState* exec, T* impl) { - PassRefPtr<SerializedScriptValue> message = SerializedScriptValue::create(exec, args.at(0)); + PassRefPtr<SerializedScriptValue> message = SerializedScriptValue::create(exec, exec->argument(0)); MessagePortArray portArray; - fillMessagePortArray(exec, args.at(1), portArray); + fillMessagePortArray(exec, exec->argument(1), portArray); if (exec->hadException()) return JSC::jsUndefined(); diff --git a/WebCore/bindings/js/JSNodeCustom.cpp b/WebCore/bindings/js/JSNodeCustom.cpp index 747f238..b7c50f2 100644 --- a/WebCore/bindings/js/JSNodeCustom.cpp +++ b/WebCore/bindings/js/JSNodeCustom.cpp @@ -68,47 +68,47 @@ using namespace JSC; namespace WebCore { -JSValue JSNode::insertBefore(ExecState* exec, const ArgList& args) +JSValue JSNode::insertBefore(ExecState* exec) { Node* imp = static_cast<Node*>(impl()); ExceptionCode ec = 0; - bool ok = imp->insertBefore(toNode(args.at(0)), toNode(args.at(1)), ec, true); + bool ok = imp->insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, true); setDOMException(exec, ec); if (ok) - return args.at(0); + return exec->argument(0); return jsNull(); } -JSValue JSNode::replaceChild(ExecState* exec, const ArgList& args) +JSValue JSNode::replaceChild(ExecState* exec) { Node* imp = static_cast<Node*>(impl()); ExceptionCode ec = 0; - bool ok = imp->replaceChild(toNode(args.at(0)), toNode(args.at(1)), ec, true); + bool ok = imp->replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, true); setDOMException(exec, ec); if (ok) - return args.at(1); + return exec->argument(1); return jsNull(); } -JSValue JSNode::removeChild(ExecState* exec, const ArgList& args) +JSValue JSNode::removeChild(ExecState* exec) { Node* imp = static_cast<Node*>(impl()); ExceptionCode ec = 0; - bool ok = imp->removeChild(toNode(args.at(0)), ec); + bool ok = imp->removeChild(toNode(exec->argument(0)), ec); setDOMException(exec, ec); if (ok) - return args.at(0); + return exec->argument(0); return jsNull(); } -JSValue JSNode::appendChild(ExecState* exec, const ArgList& args) +JSValue JSNode::appendChild(ExecState* exec) { Node* imp = static_cast<Node*>(impl()); ExceptionCode ec = 0; - bool ok = imp->appendChild(toNode(args.at(0)), ec, true); + bool ok = imp->appendChild(toNode(exec->argument(0)), ec, true); setDOMException(exec, ec); if (ok) - return args.at(0); + return exec->argument(0); return jsNull(); } diff --git a/WebCore/bindings/js/JSNodeListCustom.cpp b/WebCore/bindings/js/JSNodeListCustom.cpp index d013e4f..6d51943 100644 --- a/WebCore/bindings/js/JSNodeListCustom.cpp +++ b/WebCore/bindings/js/JSNodeListCustom.cpp @@ -36,13 +36,13 @@ using namespace JSC; namespace WebCore { // Need to support call so that list(0) works. -static JSValue JSC_HOST_CALL callNodeList(ExecState* exec, JSObject* function, JSValue, const ArgList& args) +static JSValue JSC_HOST_CALL callNodeList(ExecState* exec) { bool ok; - unsigned index = args.at(0).toString(exec).toUInt32(&ok); + unsigned index = exec->argument(0).toString(exec).toUInt32(&ok); if (!ok) return jsUndefined(); - return toJS(exec, static_cast<JSNodeList*>(function)->impl()->item(index)); + return toJS(exec, static_cast<JSNodeList*>(exec->callee())->impl()->item(index)); } CallType JSNodeList::getCallData(CallData& callData) diff --git a/WebCore/bindings/js/JSPluginElementFunctions.cpp b/WebCore/bindings/js/JSPluginElementFunctions.cpp index b20b9a7..a260782 100644 --- a/WebCore/bindings/js/JSPluginElementFunctions.cpp +++ b/WebCore/bindings/js/JSPluginElementFunctions.cpp @@ -105,11 +105,11 @@ bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSV return true; } -static JSValue JSC_HOST_CALL callPlugin(ExecState* exec, JSObject* function, JSValue, const ArgList& args) +static JSValue JSC_HOST_CALL callPlugin(ExecState* exec) { - Instance* instance = pluginInstance(static_cast<JSHTMLElement*>(function)->impl()); + Instance* instance = pluginInstance(static_cast<JSHTMLElement*>(exec->callee())->impl()); instance->begin(); - JSValue result = instance->invokeDefaultMethod(exec, args); + JSValue result = instance->invokeDefaultMethod(exec); instance->end(); return result; } diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp index 0039a05..2a504d3 100644 --- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp +++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp @@ -39,10 +39,10 @@ using namespace JSC; namespace WebCore { -JSValue JSSQLResultSetRowList::item(ExecState* exec, const ArgList& args) +JSValue JSSQLResultSetRowList::item(ExecState* exec) { bool indexOk; - int index = args.at(0).toInt32(exec, indexOk); + int index = exec->argument(0).toInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); diff --git a/WebCore/bindings/js/JSSQLTransactionCustom.cpp b/WebCore/bindings/js/JSSQLTransactionCustom.cpp index 13cc0bc..44ebb02 100644 --- a/WebCore/bindings/js/JSSQLTransactionCustom.cpp +++ b/WebCore/bindings/js/JSSQLTransactionCustom.cpp @@ -42,21 +42,21 @@ using namespace JSC; namespace WebCore { -JSValue JSSQLTransaction::executeSql(ExecState* exec, const ArgList& args) +JSValue JSSQLTransaction::executeSql(ExecState* exec) { - if (args.isEmpty()) { + if (!exec->argumentCount()) { setDOMException(exec, SYNTAX_ERR); return jsUndefined(); } - String sqlStatement = ustringToString(args.at(0).toString(exec)); + String sqlStatement = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); // Now assemble the list of SQL arguments Vector<SQLValue> sqlValues; - if (!args.at(1).isUndefinedOrNull()) { - JSObject* object = args.at(1).getObject(); + if (!exec->argument(1).isUndefinedOrNull()) { + JSObject* object = exec->argument(1).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -88,8 +88,8 @@ JSValue JSSQLTransaction::executeSql(ExecState* exec, const ArgList& args) } RefPtr<SQLStatementCallback> callback; - if (!args.at(2).isUndefinedOrNull()) { - JSObject* object = args.at(2).getObject(); + if (!exec->argument(2).isUndefinedOrNull()) { + JSObject* object = exec->argument(2).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -99,8 +99,8 @@ JSValue JSSQLTransaction::executeSql(ExecState* exec, const ArgList& args) } RefPtr<SQLStatementErrorCallback> errorCallback; - if (!args.at(3).isUndefinedOrNull()) { - JSObject* object = args.at(3).getObject(); + if (!exec->argument(3).isUndefinedOrNull()) { + JSObject* object = exec->argument(3).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); diff --git a/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp b/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp index 69fc6cf..08f42e8 100644 --- a/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp +++ b/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp @@ -41,21 +41,21 @@ using namespace JSC; namespace WebCore { -JSValue JSSQLTransactionSync::executeSql(ExecState* exec, const ArgList& args) +JSValue JSSQLTransactionSync::executeSql(ExecState* exec) { - if (args.isEmpty()) { + if (!exec->argumentCount()) { setDOMException(exec, SYNTAX_ERR); return jsUndefined(); } - String sqlStatement = ustringToString(args.at(0).toString(exec)); + String sqlStatement = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); // Now assemble the list of SQL arguments Vector<SQLValue> sqlValues; - if (!args.at(1).isUndefinedOrNull()) { - JSObject* object = args.at(1).getObject(); + if (!exec->argument(1).isUndefinedOrNull()) { + JSObject* object = exec->argument(1).getObject(); if (!object) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); diff --git a/WebCore/bindings/js/JSSVGLengthCustom.cpp b/WebCore/bindings/js/JSSVGLengthCustom.cpp index 33bbf30..c7cfdb0 100644 --- a/WebCore/bindings/js/JSSVGLengthCustom.cpp +++ b/WebCore/bindings/js/JSSVGLengthCustom.cpp @@ -35,13 +35,13 @@ JSValue JSSVGLength::value(ExecState* exec) const return jsNumber(exec, podImp.value(context)); } -JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec, const ArgList& args) +JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec) { JSSVGPODTypeWrapper<SVGLength>* imp = impl(); SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this); SVGLength podImp(*imp); - podImp.convertToSpecifiedUnits(args.at(0).toInt32(exec), context); + podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), context); imp->commitChange(podImp, this); return jsUndefined(); diff --git a/WebCore/bindings/js/JSSVGMatrixCustom.cpp b/WebCore/bindings/js/JSSVGMatrixCustom.cpp index 59e3f03..149da8a 100644 --- a/WebCore/bindings/js/JSSVGMatrixCustom.cpp +++ b/WebCore/bindings/js/JSSVGMatrixCustom.cpp @@ -31,15 +31,15 @@ using namespace JSC; namespace WebCore { -JSValue JSSVGMatrix::multiply(ExecState* exec, const ArgList& args) +JSValue JSSVGMatrix::multiply(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return throwError(exec, SyntaxError, "Not enough arguments"); - if (!args.at(0).inherits(&JSSVGMatrix::s_info)) + if (!exec->argument(0).inherits(&JSSVGMatrix::s_info)) return throwError(exec, TypeError, "secondMatrix argument was not a SVGMatrix"); - JSSVGMatrix* matrixObj = static_cast<JSSVGMatrix*>(asObject(args.at(0))); + JSSVGMatrix* matrixObj = static_cast<JSSVGMatrix*>(asObject(exec->argument(0))); AffineTransform m1(*impl()); AffineTransform m2(*(matrixObj->impl())); @@ -48,7 +48,7 @@ JSValue JSSVGMatrix::multiply(ExecState* exec, const ArgList& args) return toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(m1.multLeft(m2)).get(), context); } -JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&) +JSValue JSSVGMatrix::inverse(ExecState* exec) { AffineTransform imp(*impl()); @@ -61,12 +61,12 @@ JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&) return result; } -JSValue JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args) +JSValue JSSVGMatrix::rotateFromVector(ExecState* exec) { AffineTransform imp(*impl()); - float x = args.at(0).toFloat(exec); - float y = args.at(1).toFloat(exec); + float x = exec->argument(0).toFloat(exec); + float y = exec->argument(1).toFloat(exec); SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this); JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.rotateFromVector(x, y)).get(), context); diff --git a/WebCore/bindings/js/JSSVGPODListCustom.h b/WebCore/bindings/js/JSSVGPODListCustom.h index 8a0654c..9db5618 100644 --- a/WebCore/bindings/js/JSSVGPODListCustom.h +++ b/WebCore/bindings/js/JSSVGPODListCustom.h @@ -89,7 +89,7 @@ static JSC::JSValue finishSetterReadOnlyResult(JSC::ExecState* exec, ExceptionCo } template<typename JSPODListType, typename PODType> -static JSC::JSValue clear(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList&, +static JSC::JSValue clear(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback) { ExceptionCode ec = 0; @@ -105,21 +105,21 @@ static JSC::JSValue clear(JSPODListType* wrapper, JSC::ExecState* exec, const JS } template<typename JSPODListType, typename PODType> -static JSC::JSValue initialize(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue initialize(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback conversion) { ExceptionCode ec = 0; typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl(); return finishSetter<JSPODListType, PODType>(exec, ec, wrapper, - listImp->initialize(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec)); + listImp->initialize(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(exec->argument(0))), ec)); } template<typename JSPODListType, typename PODType> -static JSC::JSValue getItem(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue getItem(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback) { bool indexOk = false; - unsigned index = args.at(0).toUInt32(exec, indexOk); + unsigned index = exec->argument(0).toUInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return JSC::jsUndefined(); @@ -132,11 +132,11 @@ static JSC::JSValue getItem(JSPODListType* wrapper, JSC::ExecState* exec, const } template<typename JSPODListType, typename PODType> -static JSC::JSValue insertItemBefore(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue insertItemBefore(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback conversion) { bool indexOk = false; - unsigned index = args.at(1).toUInt32(exec, indexOk); + unsigned index = exec->argument(1).toUInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return JSC::jsUndefined(); @@ -145,15 +145,15 @@ static JSC::JSValue insertItemBefore(JSPODListType* wrapper, JSC::ExecState* exe ExceptionCode ec = 0; typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl(); return finishSetter<JSPODListType, PODType>(exec, ec, wrapper, - listImp->insertItemBefore(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec)); + listImp->insertItemBefore(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(exec->argument(0))), index, ec)); } template<typename JSPODListType, typename PODType> -static JSC::JSValue replaceItem(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue replaceItem(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback conversion) { bool indexOk = false; - unsigned index = args.at(1).toUInt32(exec, indexOk); + unsigned index = exec->argument(1).toUInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return JSC::jsUndefined(); @@ -162,15 +162,15 @@ static JSC::JSValue replaceItem(JSPODListType* wrapper, JSC::ExecState* exec, co ExceptionCode ec = 0; typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl(); return finishSetter<JSPODListType, PODType>(exec, ec, wrapper, - listImp->replaceItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), index, ec)); + listImp->replaceItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(exec->argument(0))), index, ec)); } template<typename JSPODListType, typename PODType> -static JSC::JSValue removeItem(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue removeItem(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback) { bool indexOk = false; - unsigned index = args.at(0).toUInt32(exec, indexOk); + unsigned index = exec->argument(0).toUInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return JSC::jsUndefined(); @@ -183,13 +183,13 @@ static JSC::JSValue removeItem(JSPODListType* wrapper, JSC::ExecState* exec, con } template<typename JSPODListType, typename PODType> -static JSC::JSValue appendItem(JSPODListType* wrapper, JSC::ExecState* exec, const JSC::ArgList& args, +static JSC::JSValue appendItem(JSPODListType* wrapper, JSC::ExecState* exec, typename JSSVGPODListTraits<PODType>::ConversionCallback conversion) { ExceptionCode ec = 0; typename JSSVGPODListTraits<PODType>::PODList* listImp = wrapper->impl(); return finishSetter<JSPODListType, PODType>(exec, ec, wrapper, - listImp->appendItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(args.at(0))), ec)); + listImp->appendItem(JSSVGPODListTraits<PODType>::PODListItem::copy(conversion(exec->argument(0))), ec)); } } diff --git a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp index 4831727..850e533 100644 --- a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp +++ b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp @@ -36,7 +36,7 @@ using namespace JSC; namespace WebCore { -JSValue JSSVGPathSegList::clear(ExecState* exec, const ArgList&) +JSValue JSSVGPathSegList::clear(ExecState* exec) { ExceptionCode ec = 0; @@ -49,10 +49,10 @@ JSValue JSSVGPathSegList::clear(ExecState* exec, const ArgList&) return jsUndefined(); } -JSValue JSSVGPathSegList::initialize(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::initialize(ExecState* exec) { ExceptionCode ec = 0; - SVGPathSeg* newItem = toSVGPathSeg(args.at(0)); + SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0)); SVGPathSegList* list = impl(); @@ -66,12 +66,12 @@ JSValue JSSVGPathSegList::initialize(ExecState* exec, const ArgList& args) return result; } -JSValue JSSVGPathSegList::getItem(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::getItem(ExecState* exec) { ExceptionCode ec = 0; bool indexOk; - unsigned index = args.at(0).toInt32(exec, indexOk); + unsigned index = exec->argument(0).toInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -86,13 +86,13 @@ JSValue JSSVGPathSegList::getItem(ExecState* exec, const ArgList& args) return result; } -JSValue JSSVGPathSegList::insertItemBefore(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::insertItemBefore(ExecState* exec) { ExceptionCode ec = 0; - SVGPathSeg* newItem = toSVGPathSeg(args.at(0)); + SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0)); bool indexOk; - unsigned index = args.at(1).toInt32(exec, indexOk); + unsigned index = exec->argument(1).toInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -108,13 +108,13 @@ JSValue JSSVGPathSegList::insertItemBefore(ExecState* exec, const ArgList& args) return result; } -JSValue JSSVGPathSegList::replaceItem(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::replaceItem(ExecState* exec) { ExceptionCode ec = 0; - SVGPathSeg* newItem = toSVGPathSeg(args.at(0)); + SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0)); bool indexOk; - unsigned index = args.at(1).toInt32(exec, indexOk); + unsigned index = exec->argument(1).toInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -130,12 +130,12 @@ JSValue JSSVGPathSegList::replaceItem(ExecState* exec, const ArgList& args) return result; } -JSValue JSSVGPathSegList::removeItem(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::removeItem(ExecState* exec) { ExceptionCode ec = 0; bool indexOk; - unsigned index = args.at(0).toInt32(exec, indexOk); + unsigned index = exec->argument(0).toInt32(exec, indexOk); if (!indexOk) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); @@ -153,10 +153,10 @@ JSValue JSSVGPathSegList::removeItem(ExecState* exec, const ArgList& args) return result; } -JSValue JSSVGPathSegList::appendItem(ExecState* exec, const ArgList& args) +JSValue JSSVGPathSegList::appendItem(ExecState* exec) { ExceptionCode ec = 0; - SVGPathSeg* newItem = toSVGPathSeg(args.at(0)); + SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0)); SVGPathSegList* list = impl(); SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this); diff --git a/WebCore/bindings/js/JSUint16ArrayCustom.cpp b/WebCore/bindings/js/JSUint16ArrayCustom.cpp index bac5220..4eb254f 100644 --- a/WebCore/bindings/js/JSUint16ArrayCustom.cpp +++ b/WebCore/bindings/js/JSUint16ArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Uint16A return getDOMObjectWrapper<JSUint16Array>(exec, globalObject, object); } -JSC::JSValue JSUint16Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSUint16Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toUint16Array); + return setWebGLArrayHelper(exec, impl(), toUint16Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSUint32ArrayCustom.cpp b/WebCore/bindings/js/JSUint32ArrayCustom.cpp index 926079d..2826b6a 100644 --- a/WebCore/bindings/js/JSUint32ArrayCustom.cpp +++ b/WebCore/bindings/js/JSUint32ArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Uint32A return getDOMObjectWrapper<JSUint32Array>(exec, globalObject, object); } -JSC::JSValue JSUint32Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSUint32Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toUint32Array); + return setWebGLArrayHelper(exec, impl(), toUint32Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSUint8ArrayCustom.cpp b/WebCore/bindings/js/JSUint8ArrayCustom.cpp index 40bfda3..45c80c0 100644 --- a/WebCore/bindings/js/JSUint8ArrayCustom.cpp +++ b/WebCore/bindings/js/JSUint8ArrayCustom.cpp @@ -46,9 +46,9 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Uint8Ar return getDOMObjectWrapper<JSUint8Array>(exec, globalObject, object); } -JSC::JSValue JSUint8Array::set(JSC::ExecState* exec, JSC::ArgList const& args) +JSC::JSValue JSUint8Array::set(JSC::ExecState* exec) { - return setWebGLArrayHelper(exec, impl(), args, toUint8Array); + return setWebGLArrayHelper(exec, impl(), toUint8Array); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp index c938aec..02dae08 100644 --- a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp +++ b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp @@ -67,21 +67,21 @@ using namespace JSC; namespace WebCore { -JSValue JSWebGLRenderingContext::bufferData(JSC::ExecState* exec, JSC::ArgList const& args) +JSValue JSWebGLRenderingContext::bufferData(JSC::ExecState* exec) { - if (args.size() != 3) + if (exec->argumentCount() != 3) return throwError(exec, SyntaxError); - unsigned target = args.at(0).toInt32(exec); - unsigned usage = args.at(2).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); + unsigned usage = exec->argument(2).toInt32(exec); ExceptionCode ec = 0; // If argument 1 is a number, we are initializing this buffer to that size - if (!args.at(1).isObject()) { - unsigned int count = args.at(1).toInt32(exec); + if (!exec->argument(1).isObject()) { + unsigned int count = exec->argument(1).toInt32(exec); static_cast<WebGLRenderingContext*>(impl())->bufferData(target, count, usage, ec); } else { - ArrayBufferView* array = toArrayBufferView(args.at(1)); + ArrayBufferView* array = toArrayBufferView(exec->argument(1)); static_cast<WebGLRenderingContext*>(impl())->bufferData(target, array, usage, ec); } @@ -89,16 +89,16 @@ JSValue JSWebGLRenderingContext::bufferData(JSC::ExecState* exec, JSC::ArgList c return jsUndefined(); } -JSValue JSWebGLRenderingContext::bufferSubData(JSC::ExecState* exec, JSC::ArgList const& args) +JSValue JSWebGLRenderingContext::bufferSubData(JSC::ExecState* exec) { - if (args.size() != 3) + if (exec->argumentCount() != 3) return throwError(exec, SyntaxError); - unsigned target = args.at(0).toInt32(exec); - unsigned offset = args.at(1).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); + unsigned offset = exec->argument(1).toInt32(exec); ExceptionCode ec = 0; - ArrayBufferView* array = toArrayBufferView(args.at(2)); + ArrayBufferView* array = toArrayBufferView(exec->argument(2)); static_cast<WebGLRenderingContext*>(impl())->bufferSubData(target, offset, array, ec); @@ -149,17 +149,17 @@ enum ObjectType { kBuffer, kRenderbuffer, kTexture, kVertexAttrib }; -static JSValue getObjectParameter(JSWebGLRenderingContext* obj, ExecState* exec, const ArgList& args, ObjectType objectType) +static JSValue getObjectParameter(JSWebGLRenderingContext* obj, ExecState* exec, ObjectType objectType) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(obj->impl()); - unsigned target = args.at(0).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned pname = args.at(1).toInt32(exec); + unsigned pname = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info; @@ -192,25 +192,25 @@ enum WhichProgramCall { kProgramParameter, kUniform }; -JSValue JSWebGLRenderingContext::getBufferParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getBufferParameter(ExecState* exec) { - return getObjectParameter(this, exec, args, kBuffer); + return getObjectParameter(this, exec, kBuffer); } -JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* exec) { - if (args.size() != 3) + if (exec->argumentCount() != 3) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - unsigned target = args.at(0).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned attachment = args.at(1).toInt32(exec); + unsigned attachment = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned pname = args.at(2).toInt32(exec); + unsigned pname = exec->argument(2).toInt32(exec); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info = context->getFramebufferAttachmentParameter(target, attachment, pname, ec); @@ -221,14 +221,14 @@ JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* ex return toJS(exec, globalObject(), info); } -JSValue JSWebGLRenderingContext::getParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getParameter(ExecState* exec) { - if (args.size() != 1) + if (exec->argumentCount() != 1) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - unsigned pname = args.at(0).toInt32(exec); + unsigned pname = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info = context->getParameter(pname, ec); @@ -239,15 +239,15 @@ JSValue JSWebGLRenderingContext::getParameter(ExecState* exec, const ArgList& ar return toJS(exec, globalObject(), info); } -JSValue JSWebGLRenderingContext::getProgramParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getProgramParameter(ExecState* exec) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - WebGLProgram* program = toWebGLProgram(args.at(0)); - unsigned pname = args.at(1).toInt32(exec); + WebGLProgram* program = toWebGLProgram(exec->argument(0)); + unsigned pname = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info = context->getProgramParameter(program, pname, ec); @@ -258,20 +258,20 @@ JSValue JSWebGLRenderingContext::getProgramParameter(ExecState* exec, const ArgL return toJS(exec, globalObject(), info); } -JSValue JSWebGLRenderingContext::getRenderbufferParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getRenderbufferParameter(ExecState* exec) { - return getObjectParameter(this, exec, args, kRenderbuffer); + return getObjectParameter(this, exec, kRenderbuffer); } -JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - WebGLShader* shader = toWebGLShader(args.at(0)); - unsigned pname = args.at(1).toInt32(exec); + WebGLShader* shader = toWebGLShader(exec->argument(0)); + unsigned pname = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info = context->getShaderParameter(shader, pname, ec); @@ -282,20 +282,20 @@ JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec, const ArgLi return toJS(exec, globalObject(), info); } -JSValue JSWebGLRenderingContext::getTexParameter(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getTexParameter(ExecState* exec) { - return getObjectParameter(this, exec, args, kTexture); + return getObjectParameter(this, exec, kTexture); } -JSValue JSWebGLRenderingContext::getUniform(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getUniform(ExecState* exec) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - WebGLProgram* program = toWebGLProgram(args.at(0)); - WebGLUniformLocation* loc = toWebGLUniformLocation(args.at(1)); + WebGLProgram* program = toWebGLProgram(exec->argument(0)); + WebGLUniformLocation* loc = toWebGLUniformLocation(exec->argument(1)); if (exec->hadException()) return jsUndefined(); WebGLGetInfo info = context->getUniform(program, loc, ec); @@ -306,9 +306,9 @@ JSValue JSWebGLRenderingContext::getUniform(ExecState* exec, const ArgList& args return toJS(exec, globalObject(), info); } -JSValue JSWebGLRenderingContext::getVertexAttrib(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::getVertexAttrib(ExecState* exec) { - return getObjectParameter(this, exec, args, kVertexAttrib); + return getObjectParameter(this, exec, kVertexAttrib); } // void texImage2D(in GLenum target, in GLint level, in GLenum internalformat, in GLsizei width, in GLsizei height, in GLint border, in GLenum format, in GLenum type, in ArrayBufferView pixels); @@ -316,35 +316,35 @@ JSValue JSWebGLRenderingContext::getVertexAttrib(ExecState* exec, const ArgList& // void texImage2D(in GLenum target, in GLint level, in HTMLImageElement image, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); // void texImage2D(in GLenum target, in GLint level, in HTMLCanvasElement canvas, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); // void texImage2D(in GLenum target, in GLint level, in HTMLVideoElement video, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); -JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec) { - if (args.size() < 3 || args.size() > 9) + if (exec->argumentCount() < 3 || exec->argumentCount() > 9) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - unsigned target = args.at(0).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned level = args.at(1).toInt32(exec); + unsigned level = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); JSObject* o = 0; - if (args.size() <= 5) { + if (exec->argumentCount() <= 5) { // This is one of the last 4 forms. Param 2 can be ImageData or <img>, <canvas> or <video> element. - JSValue value = args.at(2); + JSValue value = exec->argument(2); if (!value.isObject()) return throwError(exec, TypeError); o = asObject(value); - bool flipY = args.at(3).toBoolean(exec); - bool premultiplyAlpha = args.at(4).toBoolean(exec); + bool flipY = exec->argument(3).toBoolean(exec); + bool premultiplyAlpha = exec->argument(4).toBoolean(exec); if (o->inherits(&JSImageData::s_info)) { ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl()); @@ -363,35 +363,35 @@ JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec, const ArgList& args } else ec = TYPE_MISMATCH_ERR; } else { - if (args.size() != 9) + if (exec->argumentCount() != 9) return throwError(exec, SyntaxError); // This must be the ArrayBufferView case - unsigned internalformat = args.at(2).toInt32(exec); + unsigned internalformat = exec->argument(2).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned width = args.at(3).toInt32(exec); + unsigned width = exec->argument(3).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned height = args.at(4).toInt32(exec); + unsigned height = exec->argument(4).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned border = args.at(5).toInt32(exec); + unsigned border = exec->argument(5).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned format = args.at(6).toInt32(exec); + unsigned format = exec->argument(6).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned type = args.at(7).toInt32(exec); + unsigned type = exec->argument(7).toInt32(exec); if (exec->hadException()) return jsUndefined(); - JSValue value = args.at(8); + JSValue value = exec->argument(8); // For this case passing 0 (for a null array) is allowed if (value.isNull()) @@ -419,43 +419,43 @@ JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec, const ArgList& args // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLImageElement image, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLCanvasElement canvas, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLVideoElement video, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); -JSValue JSWebGLRenderingContext::texSubImage2D(ExecState* exec, const ArgList& args) +JSValue JSWebGLRenderingContext::texSubImage2D(ExecState* exec) { - if (args.size() < 5 || args.size() > 9) + if (exec->argumentCount() < 5 || exec->argumentCount() > 9) return throwError(exec, SyntaxError); ExceptionCode ec = 0; WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); - unsigned target = args.at(0).toInt32(exec); + unsigned target = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned level = args.at(1).toInt32(exec); + unsigned level = exec->argument(1).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned xoff = args.at(2).toInt32(exec); + unsigned xoff = exec->argument(2).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned yoff = args.at(3).toInt32(exec); + unsigned yoff = exec->argument(3).toInt32(exec); if (exec->hadException()) return jsUndefined(); JSObject* o = 0; - if (args.size() <= 7) { + if (exec->argumentCount() <= 7) { // This is one of the last 4 forms. Param 4 can be <img>, <canvas> or <video> element, of the format param. - JSValue value = args.at(4); + JSValue value = exec->argument(4); if (!value.isObject()) return throwError(exec, SyntaxError); o = asObject(value); - bool flipY = args.at(5).toBoolean(exec); - bool premultiplyAlpha = args.at(6).toBoolean(exec); + bool flipY = exec->argument(5).toBoolean(exec); + bool premultiplyAlpha = exec->argument(6).toBoolean(exec); if (o->inherits(&JSImageData::s_info)) { ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl()); @@ -475,26 +475,26 @@ JSValue JSWebGLRenderingContext::texSubImage2D(ExecState* exec, const ArgList& a ec = TYPE_MISMATCH_ERR; } else { // This must be the ArrayBufferView form - if (args.size() != 9) + if (exec->argumentCount() != 9) return throwError(exec, SyntaxError); - unsigned width = args.at(4).toInt32(exec); + unsigned width = exec->argument(4).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned height = args.at(5).toInt32(exec); + unsigned height = exec->argument(5).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned format = args.at(6).toInt32(exec); + unsigned format = exec->argument(6).toInt32(exec); if (exec->hadException()) return jsUndefined(); - unsigned type = args.at(7).toInt32(exec); + unsigned type = exec->argument(7).toInt32(exec); if (exec->hadException()) return jsUndefined(); - JSValue value = args.at(8); + JSValue value = exec->argument(8); if (!value.isObject()) context->texSubImage2D(target, level, xoff, yoff, width, height, format, type, 0, ec); else { @@ -555,23 +555,23 @@ static bool functionForUniform(DataFunctionToCall f) return false; } -static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, const JSC::ArgList& args, WebGLRenderingContext* context) +static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); WebGLUniformLocation* location = 0; long index = -1; if (functionForUniform(f)) - location = toWebGLUniformLocation(args.at(0)); + location = toWebGLUniformLocation(exec->argument(0)); else - index = args.at(0).toInt32(exec); + index = exec->argument(0).toInt32(exec); if (exec->hadException()) return jsUndefined(); - RefPtr<FloatArray> webGLArray = toFloatArray(args.at(1)); + RefPtr<FloatArray> webGLArray = toFloatArray(exec->argument(1)); if (exec->hadException()) return jsUndefined(); @@ -609,7 +609,7 @@ static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, co } Vector<float, 64> array; - if (!toVector(exec, args.at(1), array)) + if (!toVector(exec, exec->argument(1), array)) return throwError(exec, TypeError); switch (f) { @@ -643,17 +643,17 @@ static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, co return jsUndefined(); } -static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, const JSC::ArgList& args, WebGLRenderingContext* context) +static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context) { - if (args.size() != 2) + if (exec->argumentCount() != 2) return throwError(exec, SyntaxError); - WebGLUniformLocation* location = toWebGLUniformLocation(args.at(0)); + WebGLUniformLocation* location = toWebGLUniformLocation(exec->argument(0)); if (exec->hadException()) return jsUndefined(); - RefPtr<Int32Array> webGLArray = toInt32Array(args.at(1)); + RefPtr<Int32Array> webGLArray = toInt32Array(exec->argument(1)); if (exec->hadException()) return jsUndefined(); @@ -682,7 +682,7 @@ static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, co Vector<int, 64> array; - if (!toVector(exec, args.at(1), array)) + if (!toVector(exec, exec->argument(1), array)) return throwError(exec, TypeError); switch (f) { @@ -706,21 +706,21 @@ static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, co return jsUndefined(); } -static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState* exec, const JSC::ArgList& args, WebGLRenderingContext* context) +static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState* exec, WebGLRenderingContext* context) { - if (args.size() != 3) + if (exec->argumentCount() != 3) return throwError(exec, SyntaxError); - WebGLUniformLocation* location = toWebGLUniformLocation(args.at(0)); + WebGLUniformLocation* location = toWebGLUniformLocation(exec->argument(0)); if (exec->hadException()) return jsUndefined(); - bool transpose = args.at(1).toBoolean(exec); + bool transpose = exec->argument(1).toBoolean(exec); if (exec->hadException()) return jsUndefined(); - RefPtr<FloatArray> webGLArray = toFloatArray(args.at(2)); + RefPtr<FloatArray> webGLArray = toFloatArray(exec->argument(2)); if (exec->hadException()) return jsUndefined(); @@ -743,7 +743,7 @@ static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecStat } Vector<float, 64> array; - if (!toVector(exec, args.at(2), array)) + if (!toVector(exec, exec->argument(2), array)) return throwError(exec, TypeError); switch (f) { @@ -762,79 +762,79 @@ static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecStat return jsUndefined(); } -JSC::JSValue JSWebGLRenderingContext::uniform1fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform1fv(JSC::ExecState* exec) { - return dataFunctionf(f_uniform1v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_uniform1v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform1iv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform1iv(JSC::ExecState* exec) { - return dataFunctioni(f_uniform1v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctioni(f_uniform1v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform2fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform2fv(JSC::ExecState* exec) { - return dataFunctionf(f_uniform2v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_uniform2v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform2iv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform2iv(JSC::ExecState* exec) { - return dataFunctioni(f_uniform2v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctioni(f_uniform2v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform3fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform3fv(JSC::ExecState* exec) { - return dataFunctionf(f_uniform3v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_uniform3v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform3iv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform3iv(JSC::ExecState* exec) { - return dataFunctioni(f_uniform3v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctioni(f_uniform3v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform4fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform4fv(JSC::ExecState* exec) { - return dataFunctionf(f_uniform4v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_uniform4v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniform4iv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniform4iv(JSC::ExecState* exec) { - return dataFunctioni(f_uniform4v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctioni(f_uniform4v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniformMatrix2fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniformMatrix2fv(JSC::ExecState* exec) { - return dataFunctionMatrix(f_uniformMatrix2fv, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionMatrix(f_uniformMatrix2fv, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniformMatrix3fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniformMatrix3fv(JSC::ExecState* exec) { - return dataFunctionMatrix(f_uniformMatrix3fv, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionMatrix(f_uniformMatrix3fv, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::uniformMatrix4fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::uniformMatrix4fv(JSC::ExecState* exec) { - return dataFunctionMatrix(f_uniformMatrix4fv, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionMatrix(f_uniformMatrix4fv, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::vertexAttrib1fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::vertexAttrib1fv(JSC::ExecState* exec) { - return dataFunctionf(f_vertexAttrib1v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_vertexAttrib1v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::vertexAttrib2fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::vertexAttrib2fv(JSC::ExecState* exec) { - return dataFunctionf(f_vertexAttrib2v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_vertexAttrib2v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::vertexAttrib3fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::vertexAttrib3fv(JSC::ExecState* exec) { - return dataFunctionf(f_vertexAttrib3v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_vertexAttrib3v, exec, static_cast<WebGLRenderingContext*>(impl())); } -JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec) { - return dataFunctionf(f_vertexAttrib4v, exec, args, static_cast<WebGLRenderingContext*>(impl())); + return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingContext*>(impl())); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSWebSocketCustom.cpp b/WebCore/bindings/js/JSWebSocketCustom.cpp index 149ac5d..81b5b9e 100644 --- a/WebCore/bindings/js/JSWebSocketCustom.cpp +++ b/WebCore/bindings/js/JSWebSocketCustom.cpp @@ -45,12 +45,12 @@ using namespace JSC; namespace WebCore { // Custom functions -JSValue JSWebSocket::send(ExecState* exec, const ArgList& args) +JSValue JSWebSocket::send(ExecState* exec) { - if (args.size() < 1) + if (exec->argumentCount() < 1) return throwError(exec, SyntaxError, "Not enough arguments"); - const String& msg = ustringToString(args.at(0).toString(exec)); + const String& msg = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return throwError(exec, SyntaxError, "bad message data."); ExceptionCode ec = 0; diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp index 925a5c3..47a867e 100644 --- a/WebCore/bindings/js/JSWorkerContextCustom.cpp +++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp @@ -105,14 +105,14 @@ JSValue JSWorkerContext::webSocket(ExecState* exec) const } #endif -JSValue JSWorkerContext::importScripts(ExecState* exec, const ArgList& args) +JSValue JSWorkerContext::importScripts(ExecState* exec) { - if (!args.size()) + if (!exec->argumentCount()) return jsUndefined(); Vector<String> urls; - for (unsigned i = 0; i < args.size(); i++) { - urls.append(ustringToString(args.at(i).toString(exec))); + for (unsigned i = 0; i < exec->argumentCount(); i++) { + urls.append(ustringToString(exec->argument(i).toString(exec))); if (exec->hadException()) return jsUndefined(); } @@ -123,21 +123,21 @@ JSValue JSWorkerContext::importScripts(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSWorkerContext::setTimeout(ExecState* exec, const ArgList& args) +JSValue JSWorkerContext::setTimeout(ExecState* exec) { - OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, args, currentWorld(exec)); + OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec)); if (exec->hadException()) return jsUndefined(); - int delay = args.at(1).toInt32(exec); + int delay = exec->argument(1).toInt32(exec); return jsNumber(exec, impl()->setTimeout(action.release(), delay)); } -JSValue JSWorkerContext::setInterval(ExecState* exec, const ArgList& args) +JSValue JSWorkerContext::setInterval(ExecState* exec) { - OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, args, currentWorld(exec)); + OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec)); if (exec->hadException()) return jsUndefined(); - int delay = args.at(1).toInt32(exec); + int delay = exec->argument(1).toInt32(exec); return jsNumber(exec, impl()->setInterval(action.release(), delay)); } @@ -150,38 +150,38 @@ JSValue JSWorkerContext::messageChannel(ExecState* exec) const #endif #if ENABLE(DATABASE) -JSValue JSWorkerContext::openDatabase(ExecState* exec, const ArgList& args) +JSValue JSWorkerContext::openDatabase(ExecState* exec) { - if (args.size() < 4) { + if (exec->argumentCount() < 4) { setDOMException(exec, SYNTAX_ERR); return jsUndefined(); } - String name = ustringToString(args.at(0).toString(exec)); + String name = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); - String version = ustringToString(args.at(1).toString(exec)); + String version = ustringToString(exec->argument(1).toString(exec)); if (exec->hadException()) return jsUndefined(); - String displayName = ustringToString(args.at(2).toString(exec)); + String displayName = ustringToString(exec->argument(2).toString(exec)); if (exec->hadException()) return jsUndefined(); - // args.at(3) = estimated size - unsigned long estimatedSize = args.at(3).toUInt32(exec); + // exec->argument(3) = estimated size + unsigned long estimatedSize = exec->argument(3).toUInt32(exec); if (exec->hadException()) return jsUndefined(); RefPtr<DatabaseCallback> creationCallback; - if (args.size() >= 5) { - if (!args.at(4).isObject()) { + if (exec->argumentCount() >= 5) { + if (!exec->argument(4).isObject()) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); } - creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject()); + creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject()); } ExceptionCode ec = 0; @@ -190,38 +190,38 @@ JSValue JSWorkerContext::openDatabase(ExecState* exec, const ArgList& args) return result; } -JSValue JSWorkerContext::openDatabaseSync(ExecState* exec, const ArgList& args) +JSValue JSWorkerContext::openDatabaseSync(ExecState* exec) { - if (args.size() < 4) { + if (exec->argumentCount() < 4) { setDOMException(exec, SYNTAX_ERR); return jsUndefined(); } - String name = ustringToString(args.at(0).toString(exec)); + String name = ustringToString(exec->argument(0).toString(exec)); if (exec->hadException()) return jsUndefined(); - String version = ustringToString(args.at(1).toString(exec)); + String version = ustringToString(exec->argument(1).toString(exec)); if (exec->hadException()) return jsUndefined(); - String displayName = ustringToString(args.at(2).toString(exec)); + String displayName = ustringToString(exec->argument(2).toString(exec)); if (exec->hadException()) return jsUndefined(); - // args.at(3) = estimated size - unsigned long estimatedSize = args.at(3).toUInt32(exec); + // exec->argument(3) = estimated size + unsigned long estimatedSize = exec->argument(3).toUInt32(exec); if (exec->hadException()) return jsUndefined(); RefPtr<DatabaseCallback> creationCallback; - if (args.size() >= 5) { - if (!args.at(4).isObject()) { + if (exec->argumentCount() >= 5) { + if (!exec->argument(4).isObject()) { setDOMException(exec, TYPE_MISMATCH_ERR); return jsUndefined(); } - creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject()); + creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject()); } ExceptionCode ec = 0; diff --git a/WebCore/bindings/js/JSWorkerCustom.cpp b/WebCore/bindings/js/JSWorkerCustom.cpp index 09b881a..64d9d41 100644 --- a/WebCore/bindings/js/JSWorkerCustom.cpp +++ b/WebCore/bindings/js/JSWorkerCustom.cpp @@ -37,9 +37,9 @@ using namespace JSC; namespace WebCore { -JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec, const JSC::ArgList& args) +JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec) { - return handlePostMessage(exec, args, impl()); + return handlePostMessage(exec, impl()); } } // namespace WebCore diff --git a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp index 086b89d..420bf37 100644 --- a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp +++ b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp @@ -62,23 +62,23 @@ void JSXMLHttpRequest::markChildren(MarkStack& markStack) } // Custom functions -JSValue JSXMLHttpRequest::open(ExecState* exec, const ArgList& args) +JSValue JSXMLHttpRequest::open(ExecState* exec) { - if (args.size() < 2) + if (exec->argumentCount() < 2) return throwError(exec, SyntaxError, "Not enough arguments"); - const KURL& url = impl()->scriptExecutionContext()->completeURL(ustringToString(args.at(1).toString(exec))); - String method = ustringToString(args.at(0).toString(exec)); + const KURL& url = impl()->scriptExecutionContext()->completeURL(ustringToString(exec->argument(1).toString(exec))); + String method = ustringToString(exec->argument(0).toString(exec)); ExceptionCode ec = 0; - if (args.size() >= 3) { - bool async = args.at(2).toBoolean(exec); + if (exec->argumentCount() >= 3) { + bool async = exec->argument(2).toBoolean(exec); - if (args.size() >= 4 && !args.at(3).isUndefined()) { - String user = valueToStringWithNullCheck(exec, args.at(3)); + if (exec->argumentCount() >= 4 && !exec->argument(3).isUndefined()) { + String user = valueToStringWithNullCheck(exec, exec->argument(3)); - if (args.size() >= 5 && !args.at(4).isUndefined()) { - String password = valueToStringWithNullCheck(exec, args.at(4)); + if (exec->argumentCount() >= 5 && !exec->argument(4).isUndefined()) { + String password = valueToStringWithNullCheck(exec, exec->argument(4)); impl()->open(method, url, async, user, password, ec); } else impl()->open(method, url, async, user, ec); @@ -91,13 +91,13 @@ JSValue JSXMLHttpRequest::open(ExecState* exec, const ArgList& args) return jsUndefined(); } -JSValue JSXMLHttpRequest::send(ExecState* exec, const ArgList& args) +JSValue JSXMLHttpRequest::send(ExecState* exec) { ExceptionCode ec = 0; - if (args.isEmpty()) + if (!exec->argumentCount()) impl()->send(ec); else { - JSValue val = args.at(0); + JSValue val = exec->argument(0); if (val.isUndefinedOrNull()) impl()->send(ec); else if (val.inherits(&JSDocument::s_info)) diff --git a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp index 49ac234..63aa2b5 100644 --- a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp +++ b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp @@ -46,9 +46,9 @@ using namespace JSC; namespace WebCore { -JSValue JSXSLTProcessor::importStylesheet(ExecState*, const ArgList& args) +JSValue JSXSLTProcessor::importStylesheet(ExecState* exec) { - JSValue nodeVal = args.at(0); + JSValue nodeVal = exec->argument(0); if (nodeVal.inherits(&JSNode::s_info)) { JSNode* node = static_cast<JSNode*>(asObject(nodeVal)); impl()->importStylesheet(node->impl()); @@ -58,10 +58,10 @@ JSValue JSXSLTProcessor::importStylesheet(ExecState*, const ArgList& args) return jsUndefined(); } -JSValue JSXSLTProcessor::transformToFragment(ExecState* exec, const ArgList& args) +JSValue JSXSLTProcessor::transformToFragment(ExecState* exec) { - JSValue nodeVal = args.at(0); - JSValue docVal = args.at(1); + JSValue nodeVal = exec->argument(0); + JSValue docVal = exec->argument(1); if (nodeVal.inherits(&JSNode::s_info) && docVal.inherits(&JSDocument::s_info)) { WebCore::Node* node = static_cast<JSNode*>(asObject(nodeVal))->impl(); Document* doc = static_cast<Document*>(static_cast<JSDocument*>(asObject(docVal))->impl()); @@ -71,9 +71,9 @@ JSValue JSXSLTProcessor::transformToFragment(ExecState* exec, const ArgList& arg return jsUndefined(); } -JSValue JSXSLTProcessor::transformToDocument(ExecState* exec, const ArgList& args) +JSValue JSXSLTProcessor::transformToDocument(ExecState* exec) { - JSValue nodeVal = args.at(0); + JSValue nodeVal = exec->argument(0); if (nodeVal.inherits(&JSNode::s_info)) { JSNode* node = static_cast<JSNode*>(asObject(nodeVal)); RefPtr<Document> resultDocument = impl()->transformToDocument(node->impl()); @@ -85,33 +85,33 @@ JSValue JSXSLTProcessor::transformToDocument(ExecState* exec, const ArgList& arg return jsUndefined(); } -JSValue JSXSLTProcessor::setParameter(ExecState* exec, const ArgList& args) +JSValue JSXSLTProcessor::setParameter(ExecState* exec) { - if (args.at(1).isUndefinedOrNull() || args.at(2).isUndefinedOrNull()) + if (exec->argument(1).isUndefinedOrNull() || exec->argument(2).isUndefinedOrNull()) return jsUndefined(); // Throw exception? - String namespaceURI = ustringToString(args.at(0).toString(exec)); - String localName = ustringToString(args.at(1).toString(exec)); - String value = ustringToString(args.at(2).toString(exec)); + String namespaceURI = ustringToString(exec->argument(0).toString(exec)); + String localName = ustringToString(exec->argument(1).toString(exec)); + String value = ustringToString(exec->argument(2).toString(exec)); impl()->setParameter(namespaceURI, localName, value); return jsUndefined(); } -JSValue JSXSLTProcessor::getParameter(ExecState* exec, const ArgList& args) +JSValue JSXSLTProcessor::getParameter(ExecState* exec) { - if (args.at(1).isUndefinedOrNull()) + if (exec->argument(1).isUndefinedOrNull()) return jsUndefined(); - String namespaceURI = ustringToString(args.at(0).toString(exec)); - String localName = ustringToString(args.at(1).toString(exec)); + String namespaceURI = ustringToString(exec->argument(0).toString(exec)); + String localName = ustringToString(exec->argument(1).toString(exec)); String value = impl()->getParameter(namespaceURI, localName); return jsStringOrUndefined(exec, value); } -JSValue JSXSLTProcessor::removeParameter(ExecState* exec, const ArgList& args) +JSValue JSXSLTProcessor::removeParameter(ExecState* exec) { - if (args.at(1).isUndefinedOrNull()) + if (exec->argument(1).isUndefinedOrNull()) return jsUndefined(); - String namespaceURI = ustringToString(args.at(0).toString(exec)); - String localName = ustringToString(args.at(1).toString(exec)); + String namespaceURI = ustringToString(exec->argument(0).toString(exec)); + String localName = ustringToString(exec->argument(1).toString(exec)); impl()->removeParameter(namespaceURI, localName); return jsUndefined(); } diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp index 8cafefe..5a45e87 100644 --- a/WebCore/bindings/js/ScheduledAction.cpp +++ b/WebCore/bindings/js/ScheduledAction.cpp @@ -47,9 +47,9 @@ using namespace JSC; namespace WebCore { -PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, const ArgList& args, DOMWrapperWorld* isolatedWorld) +PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld* isolatedWorld) { - JSValue v = args.at(0); + JSValue v = exec->argument(0); CallData callData; if (v.getCallData(callData) == CallTypeNone) { UString string = v.toString(exec); @@ -57,18 +57,18 @@ PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, const ArgLi return 0; return new ScheduledAction(ustringToString(string), isolatedWorld); } - ArgList argsTail; - args.getSlice(2, argsTail); - return new ScheduledAction(v, argsTail, isolatedWorld); + + return new ScheduledAction(exec, v, isolatedWorld); } -ScheduledAction::ScheduledAction(JSValue function, const ArgList& args, DOMWrapperWorld* isolatedWorld) +ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWorld* isolatedWorld) : m_function(function) , m_isolatedWorld(isolatedWorld) { - ArgList::const_iterator end = args.end(); - for (ArgList::const_iterator it = args.begin(); it != end; ++it) - m_args.append(*it); + // setTimeout(function, interval, arg0, arg1...). + // Start at 2 to skip function and interval. + for (size_t i = 2; i < exec->argumentCount(); ++i) + m_args.append(exec->argument(i)); } void ScheduledAction::execute(ScriptExecutionContext* context) diff --git a/WebCore/bindings/js/ScheduledAction.h b/WebCore/bindings/js/ScheduledAction.h index 313451a..6c9d0ba 100644 --- a/WebCore/bindings/js/ScheduledAction.h +++ b/WebCore/bindings/js/ScheduledAction.h @@ -43,12 +43,12 @@ namespace WebCore { */ class ScheduledAction : public Noncopyable { public: - static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, const JSC::ArgList&, DOMWrapperWorld* isolatedWorld); + static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld* isolatedWorld); void execute(ScriptExecutionContext*); private: - ScheduledAction(JSC::JSValue function, const JSC::ArgList&, DOMWrapperWorld* isolatedWorld); + ScheduledAction(JSC::ExecState*, JSC::JSValue function, DOMWrapperWorld* isolatedWorld); ScheduledAction(const String& code, DOMWrapperWorld* isolatedWorld) : m_code(code) , m_isolatedWorld(isolatedWorld) diff --git a/WebCore/bindings/js/ScriptCallFrame.cpp b/WebCore/bindings/js/ScriptCallFrame.cpp index 19ed1ea..8381a4e 100644 --- a/WebCore/bindings/js/ScriptCallFrame.cpp +++ b/WebCore/bindings/js/ScriptCallFrame.cpp @@ -38,14 +38,16 @@ using namespace JSC; namespace WebCore { -ScriptCallFrame::ScriptCallFrame(const UString& functionName, const UString& urlString, int lineNumber, const ArgList& args, unsigned skipArgumentCount) +ScriptCallFrame::ScriptCallFrame(const UString& functionName, const UString& urlString, int lineNumber, ExecState* exec, unsigned skipArgumentCount) : m_functionName(functionName) , m_sourceURL(ParsedURLString, ustringToString(urlString)) , m_lineNumber(lineNumber) { - size_t argumentCount = args.size(); + if (!exec) + return; + size_t argumentCount = exec->argumentCount(); for (size_t i = skipArgumentCount; i < argumentCount; ++i) - m_arguments.append(ScriptValue(args.at(i))); + m_arguments.append(ScriptValue(exec->argument(i))); } ScriptCallFrame::~ScriptCallFrame() diff --git a/WebCore/bindings/js/ScriptCallFrame.h b/WebCore/bindings/js/ScriptCallFrame.h index b8c0aba..202f4b6 100644 --- a/WebCore/bindings/js/ScriptCallFrame.h +++ b/WebCore/bindings/js/ScriptCallFrame.h @@ -50,7 +50,7 @@ namespace WebCore { // <https://bugs.webkit.org/show_bug.cgi?id=21180> class ScriptCallFrame { public: - ScriptCallFrame(const JSC::UString& functionName, const JSC::UString& urlString, int lineNumber, const JSC::ArgList&, unsigned skipArgumentCount); + ScriptCallFrame(const JSC::UString& functionName, const JSC::UString& urlString, int lineNumber, JSC::ExecState*, unsigned skipArgumentCount); ~ScriptCallFrame(); const ScriptString& functionName() const { return m_functionName; } diff --git a/WebCore/bindings/js/ScriptCallStack.cpp b/WebCore/bindings/js/ScriptCallStack.cpp index 64600cf..86ddcd1 100644 --- a/WebCore/bindings/js/ScriptCallStack.cpp +++ b/WebCore/bindings/js/ScriptCallStack.cpp @@ -42,7 +42,7 @@ using namespace JSC; namespace WebCore { -ScriptCallStack::ScriptCallStack(ExecState* exec, const ArgList& args, unsigned skipArgumentCount) +ScriptCallStack::ScriptCallStack(ExecState* exec, unsigned skipArgumentCount) : m_initialized(false) , m_exec(exec) , m_caller(0) @@ -58,11 +58,11 @@ ScriptCallStack::ScriptCallStack(ExecState* exec, const ArgList& args, unsigned if (function) { m_caller = asFunction(function); - m_frames.append(ScriptCallFrame(m_caller->name(m_exec), urlString, lineNumber, args, skipArgumentCount)); + m_frames.append(ScriptCallFrame(m_caller->name(m_exec), urlString, lineNumber, m_exec, skipArgumentCount)); } else { // Caller is unknown, but we should still add the frame, because // something called us, and gave us arguments. - m_frames.append(ScriptCallFrame(UString(), urlString, lineNumber, args, skipArgumentCount)); + m_frames.append(ScriptCallFrame(UString(), urlString, lineNumber, m_exec, skipArgumentCount)); } } @@ -94,14 +94,13 @@ void ScriptCallStack::initialize() JSValue func = m_exec->interpreter()->retrieveCaller(m_exec, m_caller); while (!func.isNull()) { JSFunction* jsFunction = asFunction(func); - ArgList emptyArgList; - m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), UString(), 0, emptyArgList, 0)); + m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), UString(), 0, 0, 0)); func = m_exec->interpreter()->retrieveCaller(m_exec, jsFunction); } m_initialized = true; } -bool ScriptCallStack::callLocation(String*, int*, String*) +bool ScriptCallStack::stackTrace(int, ScriptState*, ScriptArray&) { return false; } diff --git a/WebCore/bindings/js/ScriptCallStack.h b/WebCore/bindings/js/ScriptCallStack.h index 7b66a97..6cf7679 100644 --- a/WebCore/bindings/js/ScriptCallStack.h +++ b/WebCore/bindings/js/ScriptCallStack.h @@ -31,6 +31,7 @@ #ifndef ScriptCallStack_h #define ScriptCallStack_h +#include "ScriptArray.h" #include "ScriptCallFrame.h" #include "ScriptState.h" #include "ScriptString.h" @@ -45,7 +46,7 @@ namespace WebCore { class ScriptCallStack : public Noncopyable { public: - ScriptCallStack(JSC::ExecState*, const JSC::ArgList&, unsigned skipArgumentCount = 0); + ScriptCallStack(JSC::ExecState*, unsigned skipArgumentCount = 0); ~ScriptCallStack(); ScriptState* state() const { return m_exec; } @@ -53,7 +54,7 @@ namespace WebCore { // frame retrieval methods const ScriptCallFrame &at(unsigned); unsigned size(); - static bool callLocation(String*, int*, String*); + static bool stackTrace(int, ScriptState*, ScriptArray&); private: void initialize(); diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h index 877eb9f..16fe4f2 100644 --- a/WebCore/bindings/js/ScriptController.h +++ b/WebCore/bindings/js/ScriptController.h @@ -142,6 +142,9 @@ public: void clearWindowShell(bool goingIntoPageCache = false); void updateDocument(); + void namedItemAdded(HTMLDocument*, const AtomicString&) { } + void namedItemRemoved(HTMLDocument*, const AtomicString&) { } + // Notifies the ScriptController that the securityOrigin of the current // document was modified. For example, this method is called when // document.domain is set. This method is *not* called when a new document diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp index 8f476b4..94d7e73 100644 --- a/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/WebCore/bindings/js/ScriptDebugServer.cpp @@ -245,11 +245,16 @@ JavaScriptCallFrame* ScriptDebugServer::currentCallFrame() return m_currentCallFrame.get(); } -ScriptState* ScriptDebugServer::currentCallFrameState() +void ScriptDebugServer::dispatchDidPause(ScriptDebugListener* listener) { - if (!m_paused) - return 0; - return m_currentCallFrame->scopeChain()->globalObject->globalExec(); + ASSERT(m_paused); + ScriptState* state = m_currentCallFrame->scopeChain()->globalObject->globalExec(); + listener->didPause(state); +} + +void ScriptDebugServer::dispatchDidContinue(ScriptDebugListener* listener) +{ + listener->didContinue(); } void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source) @@ -335,7 +340,7 @@ void ScriptDebugServer::dispatchFunctionToListeners(const ListenerSet& listeners Vector<ScriptDebugListener*> copy; copyToVector(listeners, copy); for (size_t i = 0; i < copy.size(); ++i) - (copy[i]->*callback)(); + (this->*callback)(copy[i]); } void ScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback callback, Page* page) @@ -431,7 +436,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page) m_pauseOnNextStatement = false; m_paused = true; - dispatchFunctionToListeners(&ScriptDebugListener::didPause, page); + dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause, page); setJavaScriptPaused(page->group(), true); @@ -446,7 +451,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page) m_paused = false; - dispatchFunctionToListeners(&ScriptDebugListener::didContinue, page); + dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, page); } void ScriptDebugServer::callEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) diff --git a/WebCore/bindings/js/ScriptDebugServer.h b/WebCore/bindings/js/ScriptDebugServer.h index 4740585..cfada27 100644 --- a/WebCore/bindings/js/ScriptDebugServer.h +++ b/WebCore/bindings/js/ScriptDebugServer.h @@ -34,7 +34,6 @@ #include "PlatformString.h" #include "ScriptBreakpoint.h" -#include "ScriptState.h" #include "Timer.h" #include <debugger/Debugger.h> @@ -86,13 +85,12 @@ public: void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0); JavaScriptCallFrame* currentCallFrame(); - ScriptState* currentCallFrameState(); void pageCreated(Page*); private: typedef HashSet<ScriptDebugListener*> ListenerSet; - typedef void (ScriptDebugListener::*JavaScriptExecutionCallback)(); + typedef void (ScriptDebugServer::*JavaScriptExecutionCallback)(ScriptDebugListener*); ScriptDebugServer(); ~ScriptDebugServer(); @@ -109,6 +107,8 @@ private: void dispatchFunctionToListeners(JavaScriptExecutionCallback, Page*); void dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback callback); + void dispatchDidPause(ScriptDebugListener*); + void dispatchDidContinue(ScriptDebugListener*); void dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source); void dispatchFailedToParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, int errorLine, const String& errorMessage); |