Skip to content

Commit

Permalink
🦄 refactor: Removed V8Runtime.hasScheduledException() and V8Runtime.p…
Browse files Browse the repository at this point in the history
…romoteScheduledException()
  • Loading branch information
caoccao committed Oct 1, 2024
1 parent 1b69d57 commit 4bf7dd1
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 62 deletions.
16 changes: 0 additions & 16 deletions cpp/jni/com_caoccao_javet_interop_V8Native.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions cpp/jni/javet_jni_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasPendingMes
return v8InternalIsolate->has_pending_message();
}

JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasScheduledException
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
return false;
}

JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_promoteScheduledException
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
return false;
}

JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_reportPendingMessages
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
RUNTIME_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle);
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/release_notes_4_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Release Notes 4.0.x

* Upgraded Node.js to ``v22.9.0`` `(2024-09-17) <https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.9.0>`_
* Renamed ``V8Runtime.hasPendingException()`` to ``V8Runtime.hasException()``
* Removed ``V8Runtime.hasScheduledException()`` and ``V8Runtime.promoteScheduledException()``
4 changes: 0 additions & 4 deletions src/main/java/com/caoccao/javet/interop/IV8Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ boolean functionSetSourceCode(

boolean hasPendingMessage(long v8RuntimeHandle);

boolean hasScheduledException(long v8RuntimeHandle);

Object integerObjectCreate(long v8RuntimeHandle, int intValue);

Object integerObjectValueOf(long v8RuntimeHandle, long v8ValueHandle, int v8ValueType);
Expand Down Expand Up @@ -338,8 +336,6 @@ Object promiseThen(
long v8RuntimeHandle, long v8ValueHandle, int v8ValueType,
long v8ValueFunctionFulfilledHandle, long v8ValueFunctionRejectedHandle);

boolean promoteScheduledException(long v8RuntimeHandle);

Object proxyCreate(long v8RuntimeHandle, Object target);

Object proxyGetHandler(long v8RuntimeHandle, long v8ValueHandle, int v8ValueType);
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/caoccao/javet/interop/V8Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ public native boolean functionSetSourceCode(
@Override
public native boolean hasPendingMessage(long v8RuntimeHandle);

@Override
public native boolean hasScheduledException(long v8RuntimeHandle);

@Override
public native Object integerObjectCreate(long v8RuntimeHandle, int intValue);

Expand Down Expand Up @@ -516,9 +513,6 @@ public native Object promiseThen(
long v8RuntimeHandle, long v8ValueHandle, int v8ValueType,
long v8ValueFunctionFulfilledHandle, long v8ValueFunctionRejectedHandle);

@Override
public native boolean promoteScheduledException(long v8RuntimeHandle);

@Override
public native Object proxyCreate(long v8RuntimeHandle, Object target);

Expand Down
24 changes: 0 additions & 24 deletions src/main/java/com/caoccao/javet/interop/V8Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1756,18 +1756,6 @@ public boolean hasPendingMessage() throws JavetException {
return v8Native.hasPendingMessage(handle);
}

/**
* Has scheduled exception.
*
* @return true : yes, false : no
* @throws JavetException the javet exception
* @since 1.0.4
*/
@SuppressWarnings("RedundantThrows")
public boolean hasScheduledException() throws JavetException {
return v8Native.hasScheduledException(handle);
}

/**
* Initialize V8 value cache.
*
Expand Down Expand Up @@ -3044,18 +3032,6 @@ <T extends V8ValuePromise> T promiseThen(
functionRejectedHandle == null ? 0L : functionRejectedHandle.getHandle());
}

/**
* Promote scheduled exception.
*
* @return true : success, false : failure
* @throws JavetException the javet exception
* @since 1.0.4
*/
@SuppressWarnings("RedundantThrows")
public boolean promoteScheduledException() throws JavetException {
return v8Native.promoteScheduledException(handle);
}

/**
* Gets a handler from a proxy
*
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/com/caoccao/javet/interop/TestV8Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ public void testPending() throws JavetException {
try (V8Runtime v8Runtime = v8Host.createV8Runtime()) {
assertFalse(v8Runtime.hasException());
assertFalse(v8Runtime.hasPendingMessage());
assertFalse(v8Runtime.hasScheduledException());
assertFalse(v8Runtime.promoteScheduledException());
assertFalse(v8Runtime.reportPendingMessages());
}
}
Expand Down

0 comments on commit 4bf7dd1

Please sign in to comment.