Skip to content

Commit 4bf7dd1

Browse files
committed
🦄 refactor: Removed V8Runtime.hasScheduledException() and V8Runtime.promoteScheduledException()
1 parent 1b69d57 commit 4bf7dd1

File tree

7 files changed

+1
-62
lines changed

7 files changed

+1
-62
lines changed

‎cpp/jni/com_caoccao_javet_interop_V8Native.h

-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cpp/jni/javet_jni_error.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasPendingMes
4949
return v8InternalIsolate->has_pending_message();
5050
}
5151

52-
JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasScheduledException
53-
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
54-
return false;
55-
}
56-
57-
JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_promoteScheduledException
58-
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
59-
return false;
60-
}
61-
6252
JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_reportPendingMessages
6353
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
6454
RUNTIME_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle);

‎docs/release_notes/release_notes_4_0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Release Notes 4.0.x
77

88
* 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>`_
99
* Renamed ``V8Runtime.hasPendingException()`` to ``V8Runtime.hasException()``
10+
* Removed ``V8Runtime.hasScheduledException()`` and ``V8Runtime.promoteScheduledException()``

‎src/main/java/com/caoccao/javet/interop/IV8Native.java

-4
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ boolean functionSetSourceCode(
150150

151151
boolean hasPendingMessage(long v8RuntimeHandle);
152152

153-
boolean hasScheduledException(long v8RuntimeHandle);
154-
155153
Object integerObjectCreate(long v8RuntimeHandle, int intValue);
156154

157155
Object integerObjectValueOf(long v8RuntimeHandle, long v8ValueHandle, int v8ValueType);
@@ -338,8 +336,6 @@ Object promiseThen(
338336
long v8RuntimeHandle, long v8ValueHandle, int v8ValueType,
339337
long v8ValueFunctionFulfilledHandle, long v8ValueFunctionRejectedHandle);
340338

341-
boolean promoteScheduledException(long v8RuntimeHandle);
342-
343339
Object proxyCreate(long v8RuntimeHandle, Object target);
344340

345341
Object proxyGetHandler(long v8RuntimeHandle, long v8ValueHandle, int v8ValueType);

‎src/main/java/com/caoccao/javet/interop/V8Native.java

-6
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ public native boolean functionSetSourceCode(
215215
@Override
216216
public native boolean hasPendingMessage(long v8RuntimeHandle);
217217

218-
@Override
219-
public native boolean hasScheduledException(long v8RuntimeHandle);
220-
221218
@Override
222219
public native Object integerObjectCreate(long v8RuntimeHandle, int intValue);
223220

@@ -516,9 +513,6 @@ public native Object promiseThen(
516513
long v8RuntimeHandle, long v8ValueHandle, int v8ValueType,
517514
long v8ValueFunctionFulfilledHandle, long v8ValueFunctionRejectedHandle);
518515

519-
@Override
520-
public native boolean promoteScheduledException(long v8RuntimeHandle);
521-
522516
@Override
523517
public native Object proxyCreate(long v8RuntimeHandle, Object target);
524518

‎src/main/java/com/caoccao/javet/interop/V8Runtime.java

-24
Original file line numberDiff line numberDiff line change
@@ -1756,18 +1756,6 @@ public boolean hasPendingMessage() throws JavetException {
17561756
return v8Native.hasPendingMessage(handle);
17571757
}
17581758

1759-
/**
1760-
* Has scheduled exception.
1761-
*
1762-
* @return true : yes, false : no
1763-
* @throws JavetException the javet exception
1764-
* @since 1.0.4
1765-
*/
1766-
@SuppressWarnings("RedundantThrows")
1767-
public boolean hasScheduledException() throws JavetException {
1768-
return v8Native.hasScheduledException(handle);
1769-
}
1770-
17711759
/**
17721760
* Initialize V8 value cache.
17731761
*
@@ -3044,18 +3032,6 @@ <T extends V8ValuePromise> T promiseThen(
30443032
functionRejectedHandle == null ? 0L : functionRejectedHandle.getHandle());
30453033
}
30463034

3047-
/**
3048-
* Promote scheduled exception.
3049-
*
3050-
* @return true : success, false : failure
3051-
* @throws JavetException the javet exception
3052-
* @since 1.0.4
3053-
*/
3054-
@SuppressWarnings("RedundantThrows")
3055-
public boolean promoteScheduledException() throws JavetException {
3056-
return v8Native.promoteScheduledException(handle);
3057-
}
3058-
30593035
/**
30603036
* Gets a handler from a proxy
30613037
*

‎src/test/java/com/caoccao/javet/interop/TestV8Runtime.java

-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ public void testPending() throws JavetException {
164164
try (V8Runtime v8Runtime = v8Host.createV8Runtime()) {
165165
assertFalse(v8Runtime.hasException());
166166
assertFalse(v8Runtime.hasPendingMessage());
167-
assertFalse(v8Runtime.hasScheduledException());
168-
assertFalse(v8Runtime.promoteScheduledException());
169167
assertFalse(v8Runtime.reportPendingMessages());
170168
}
171169
}

0 commit comments

Comments
 (0)