Bug 24478 - Add a new API to interrupt running javascript code from C++ side.
Summary: Add a new API to interrupt running javascript code from C++ side.
Status: RESOLVED DUPLICATE of bug 41765
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-09 20:05 PDT by James Su
Modified: 2012-03-13 13:26 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Su 2009-03-09 20:05:12 PDT
When running a piece of javascript code by using JSEvaluateScript() or JSObjectCallAsFunction(), the native code might be blocked because of dead loop or some other abnormal things in javascript code. In this case, a mechanism to let native code be able to interrupt the javascript code by throwing a javascript exception would be very useful.

A simple solution would be: Provides an API to let C++ code register a callback to JavaScriptCore, then this callback will be called after certain number of javascript instructions have been executed.

SpiderMonkey has similar feature, see:
https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback
https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback
Comment 1 Gavin Barraclough 2012-03-13 13:26:00 PDT

*** This bug has been marked as a duplicate of bug 41765 ***