[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdelibs/khtml/ecma
From: Maks Orlovich <maksim () kde ! org>
Date: 2006-04-09 16:08:20
Message-ID: 1144598900.058884.547.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 527939 by orlovich:
Noticed when doing my taxes online: apparently IE
supports call notations on the frame array, e.g.
frames("foo"). Testcase upcoming..
M +15 -0 kjs_window.cpp
--- branches/KDE/3.5/kdelibs/khtml/ecma/kjs_window.cpp #527938:527939
@@ -106,6 +106,8 @@
FrameArray(ExecState *exec, KHTMLPart *p)
: ObjectImp(exec->interpreter()->builtinObjectPrototype()), part(p) { }
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+ virtual bool implementsCall() const { return true; }
private:
QGuardedPtr<KHTMLPart> part;
};
@@ -2231,6 +2233,19 @@
return ObjectImp::get(exec, p);
}
+Value FrameArray::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+{
+ //IE supports a subset of the get functionality as call...
+ //... basically, when the return is a window, it supports that, otherwise it
+ //errors out. We do a cheap-and-easy emulation of that, and just do the same
+ //thing as get does.
+ if (args.size() == 1)
+ return get(exec, Identifier(args[0].toString(exec)));
+
+ return Undefined();
+}
+
+
////////////////////// Location Object ////////////////////////
const ClassInfo Location::info = { "Location", 0, &LocationTable, 0 };
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic