mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
[ecmascript] dynamic_cast
This commit is contained in:
parent
022a066201
commit
3dcd66c3db
@ -106,7 +106,7 @@ js_htmlCollection_item2(JSContext *ctx, JSValueConst this_val, int idx)
|
||||
xmlpp::Element *element;
|
||||
|
||||
try {
|
||||
element = ns->at(idx);
|
||||
element = dynamic_cast<xmlpp::Element *>(ns->at(idx));
|
||||
} catch (std::out_of_range e) { return JS_UNDEFINED;}
|
||||
|
||||
if (!element) {
|
||||
@ -208,7 +208,7 @@ js_htmlCollection_set_items(JSContext *ctx, JSValue this_val, void *node)
|
||||
|
||||
while (1) {
|
||||
try {
|
||||
element = ns->at(counter);
|
||||
element = dynamic_cast<xmlpp::Element *>(ns->at(counter));
|
||||
} catch (std::out_of_range e) { return;}
|
||||
|
||||
if (!element) {
|
||||
|
@ -228,7 +228,7 @@ htmlCollection_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::Mutab
|
||||
xmlpp::Element *element;
|
||||
|
||||
try {
|
||||
element = ns->at(index);
|
||||
element = dynamic_cast<xmlpp::Element *>(ns->at(index));
|
||||
} catch (std::out_of_range e) { return true;}
|
||||
|
||||
if (!element) {
|
||||
@ -333,7 +333,7 @@ htmlCollection_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
|
||||
|
||||
while (1) {
|
||||
try {
|
||||
element = ns->at(counter);
|
||||
element = dynamic_cast<xmlpp::Element *>(ns->at(counter));
|
||||
} catch (std::out_of_range e) { return true;}
|
||||
|
||||
if (!element) {
|
||||
|
Loading…
Reference in New Issue
Block a user