Java Code Examples for org.mozilla.javascript.Context#captureContinuation()

The following examples show how to use org.mozilla.javascript.Context#captureContinuation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContinuationsApiTest.java    From rhino-android with Apache License 2.0 5 votes vote down vote up
public int f(int a) {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(a);
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 2
Source File: ContinuationsApiTest.java    From rhino-android with Apache License 2.0 5 votes vote down vote up
public int g(int a) {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(2*a);
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 3
Source File: ContinuationsApiTest.java    From rhino-android with Apache License 2.0 5 votes vote down vote up
public String h() {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState("2*3");
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 4
Source File: ContinuationsApiTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public int f(int a) {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(a);
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 5
Source File: ContinuationsApiTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public int g(int a) {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(2*a);
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 6
Source File: ContinuationsApiTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public String h() {
    Context cx = Context.enter();
    try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState("2*3");
        throw pending;
    } finally {
        Context.exit();
    }
}
 
Example 7
Source File: Bug685403Test.java    From rhino-android with Apache License 2.0 4 votes vote down vote up
public static Object continuation(Context cx, Scriptable thisObj,
        Object[] args, Function funObj) {
    ContinuationPending pending = cx.captureContinuation();
    throw pending;
}