Skip to content

Commit

Permalink
🔥 Javet v3.1.2 (#335)
Browse files Browse the repository at this point in the history
* Upgraded Node.js to `v20.13.1` ([2024-05-09](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.13.1))
* Upgraded V8 to `v12.5.227.6` (2024-04-26)
* Upgraded Visual Studio 2022 to v17.9.6
* Added `V8AwaitMode.RunNoWait`
* Fixed unexpected behavior of `V8AwaitMode.RunOnce`
* Enabled `__dirname`, `__filename`, `require` root injection for Node.js Android
  • Loading branch information
caoccao authored May 11, 2024
1 parent 320e6e5 commit 585b319
Show file tree
Hide file tree
Showing 513 changed files with 2,174 additions and 1,905 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android_node_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.12.2
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_VERSION: 3.1.2
ROOT: /home/runner/work/Javet

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android_v8_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2
ROOT: /home/runner/work/Javet

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 20.12.2
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2

jobs:
javet_linux_x86_64:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 20.12.2
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2

# if we skip a job using a job level `if` condition, then any dependent jobs also don't run.
# we can skip a step of the job, using a step level `if` condition.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.12.2
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2
ROOT: /home/runner/work/Javet

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos_arm64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.12.2
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2
ROOT: /Users/runner/work/Javet

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.12.2
JAVET_V8_VERSION: 12.4.254.9
JAVET_VERSION: 3.1.1
JAVET_NODE_VERSION: 20.13.1
JAVET_V8_VERSION: 12.5.227.6
JAVET_VERSION: 3.1.2
ROOT: /Users/runner/work/Javet

jobs:
Expand Down
28 changes: 14 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ arm ✔️ ❌ ❌ ❌
arm64 ✔️ ✔️ ✔️ ❌
=========== ======= ======= ======= =======

* Node.js ``v20.12.2`` + V8 ``v12.4.254.9``
* Node.js ``v20.13.1`` + V8 ``v12.5.227.6``
* Dynamic switch between Node.js and V8 mode (`Which mode do you prefer? <https://github.com/caoccao/Javet/discussions/92>`_)
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
* V8 API exposure in JVM
Expand Down Expand Up @@ -75,44 +75,44 @@ Maven
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</dependency>
<!-- Linux (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-linux-arm64</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

.. code-block:: kotlin
implementation("com.caoccao.javet:javet:3.1.1") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:3.1.1") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:3.1.1") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android-node:3.1.1") // Android Node (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet-android-v8:3.1.1") // Android V8 (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet:3.1.2") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:3.1.2") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:3.1.2") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android-node:3.1.2") // Android Node (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet-android-v8:3.1.2") // Android V8 (arm, arm64, x86 and x86_64)
Gradle Groovy DSL
^^^^^^^^^^^^^^^^^

.. code-block:: groovy
implementation 'com.caoccao.javet:javet:3.1.1' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:3.1.1' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:3.1.1' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android-node:3.1.1' // Android Node (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet-android-v8:3.1.1' // Android V8 (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet:3.1.2' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:3.1.2' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:3.1.2' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android-node:3.1.2' // Android Node (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet-android-v8:3.1.2' // Android V8 (arm, arm64, x86 and x86_64)
Hello Javet
-----------
Expand Down
2 changes: 1 addition & 1 deletion android/javet-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object Config {
const val ANDROIDX_TEST = "1.1.5"
const val APPCOMPAT = "1.3.1"
const val DESUGAR_JDK_LIBS = "2.0.4"
const val JAVET = "3.1.1"
const val JAVET = "3.1.2"
const val JUNIT = "5.10.1"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/javet-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="3.1.1"
android:versionName="3.1.2"
>

</manifest>
4 changes: 2 additions & 2 deletions android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.caoccao.javet</groupId>
<artifactId>javet-android</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
<name>javet</name>
<packaging>aar</packaging>
<description>Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding V8 in Java.</description>
Expand All @@ -29,7 +29,7 @@
<connection>scm:git:git://github.com/caoccao/Javet.git</connection>
<developerConnection>scm:git:git@github.com:caoccao/caoccao.git</developerConnection>
<url>https://github.com/caoccao/Javet</url>
<tag>3.1.1</tag>
<tag>3.1.2</tag>
</scm>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object Config {
const val BYTE_BUDDY = "1.14.10"
const val JACKSON_DATABIND = "2.16.0"
const val JAVA_VERSION = "1.8"
const val JAVET = "3.1.1"
const val JAVET = "3.1.2"
const val JETTY_WEBSOCKET = "9.4.53.v20231009"
const val JUNIT = "5.10.1"
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-android.sh -DV8_DIR=${HOME}/v8 -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
# Usage for Node: sh build-android.sh -DNODE_DIR=${HOME}/node -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
JAVET_VERSION=3.1.1
JAVET_VERSION=3.1.2
rm -rf build_android
mkdir build_android
cd build_android
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-linux-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-linux-arm64.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux-arm64.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=3.1.1
JAVET_VERSION=3.1.2
rm -rf build_linux_arm64
mkdir build_linux_arm64
cd build_linux_arm64
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-linux-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-linux-x86_64.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux-x86_64.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=3.1.1
JAVET_VERSION=3.1.2
rm -rf build_linux_x86_64
mkdir build_linux_x86_64
cd build_linux_x86_64
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-macos.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-macos.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=3.1.1
JAVET_VERSION=3.1.2
rm -rf build_macos
mkdir build_macos
cd build_macos
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-windows.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
REM Usage for V8: build -DV8_DIR=C:\v8
REM Usage for Node: build -DNODE_DIR=C:\node
SET JAVET_VERSION=3.1.1
SET JAVET_VERSION=3.1.2
rd /s/q build_windows
mkdir build_windows
cd build_windows
Expand Down
5 changes: 3 additions & 2 deletions cpp/jni/javet_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ namespace Javet {

namespace V8AwaitMode {
enum V8AwaitMode {
RunOnce = 0,
RunTillNoMoreTasks = 1,
RunNoWait = 2,
RunOnce = 1,
RunTillNoMoreTasks = 0,
};
};

Expand Down
108 changes: 54 additions & 54 deletions cpp/jni/javet_jni_core_v8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,60 +172,60 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasInternalTy
using namespace Javet::Enums::V8ValueInternalType;
switch (v8ValueInternalType)
{
case V8ValueInternalType::Undefined: return v8LocalValue->IsUndefined(); // 0
case V8ValueInternalType::Null: return v8LocalValue->IsNull(); // 1
case V8ValueInternalType::NullOrUndefined: return v8LocalValue->IsNullOrUndefined(); // 2
case V8ValueInternalType::True: return v8LocalValue->IsTrue(); // 3
case V8ValueInternalType::False: return v8LocalValue->IsFalse(); // 4
case V8ValueInternalType::Name: return v8LocalValue->IsName(); // 5
case V8ValueInternalType::String: return v8LocalValue->IsString(); // 6
case V8ValueInternalType::Symbol: return v8LocalValue->IsSymbol(); // 7
case V8ValueInternalType::Function: return v8LocalValue->IsFunction(); // 8
case V8ValueInternalType::Array: return v8LocalValue->IsArray(); // 9
case V8ValueInternalType::Object: return v8LocalValue->IsObject(); // 10
case V8ValueInternalType::BigInt: return v8LocalValue->IsBigInt(); // 11
case V8ValueInternalType::Boolean: return v8LocalValue->IsBoolean(); // 12
case V8ValueInternalType::Number: return v8LocalValue->IsNumber(); // 13
case V8ValueInternalType::External: return v8LocalValue->IsExternal(); // 14
case V8ValueInternalType::Int32: return v8LocalValue->IsInt32(); // 15
case V8ValueInternalType::Date: return v8LocalValue->IsDate(); // 16
case V8ValueInternalType::ArgumentsObject: return v8LocalValue->IsArgumentsObject(); // 17
case V8ValueInternalType::BigIntObject: return v8LocalValue->IsBigIntObject(); // 18
case V8ValueInternalType::BooleanObject: return v8LocalValue->IsBooleanObject(); // 19
case V8ValueInternalType::NumberObject: return v8LocalValue->IsNumberObject(); // 20
case V8ValueInternalType::StringObject: return v8LocalValue->IsStringObject(); // 21
case V8ValueInternalType::SymbolObject: return v8LocalValue->IsSymbolObject(); // 22
case V8ValueInternalType::NativeError: return v8LocalValue->IsNativeError(); // 23
case V8ValueInternalType::RegExp: return v8LocalValue->IsRegExp(); // 24
case V8ValueInternalType::AsyncFunction: return v8LocalValue->IsAsyncFunction(); // 25
case V8ValueInternalType::GeneratorFunction: return v8LocalValue->IsGeneratorFunction(); // 26
case V8ValueInternalType::GeneratorObject: return v8LocalValue->IsGeneratorObject(); // 27
case V8ValueInternalType::Promise: return v8LocalValue->IsPromise(); // 28
case V8ValueInternalType::Map: return v8LocalValue->IsMap(); // 29
case V8ValueInternalType::Set: return v8LocalValue->IsSet(); // 30
case V8ValueInternalType::MapIterator: return v8LocalValue->IsMapIterator(); // 31
case V8ValueInternalType::SetIterator: return v8LocalValue->IsSetIterator(); // 32
case V8ValueInternalType::WeakMap: return v8LocalValue->IsWeakMap(); // 33
case V8ValueInternalType::WeakSet: return v8LocalValue->IsWeakSet(); // 34
case V8ValueInternalType::ArrayBuffer: return v8LocalValue->IsArrayBuffer(); // 35
case V8ValueInternalType::ArrayBufferView: return v8LocalValue->IsArrayBufferView(); // 36
case V8ValueInternalType::TypedArray: return v8LocalValue->IsTypedArray(); // 37
case V8ValueInternalType::Uint8Array: return v8LocalValue->IsUint8Array(); // 38
case V8ValueInternalType::Uint8ClampedArray: return v8LocalValue->IsUint8ClampedArray(); // 39
case V8ValueInternalType::Int8Array: return v8LocalValue->IsInt8Array(); // 40
case V8ValueInternalType::Uint16Array: return v8LocalValue->IsUint16Array(); // 41
case V8ValueInternalType::Int16Array: return v8LocalValue->IsInt16Array(); // 42
case V8ValueInternalType::Uint32Array: return v8LocalValue->IsUint32Array(); // 43
case V8ValueInternalType::Int32Array: return v8LocalValue->IsInt32Array(); // 44
case V8ValueInternalType::Float32Array: return v8LocalValue->IsFloat32Array(); // 45
case V8ValueInternalType::Float64Array: return v8LocalValue->IsFloat64Array(); // 46
case V8ValueInternalType::BigInt64Array: return v8LocalValue->IsBigInt64Array(); // 47
case V8ValueInternalType::BigUint64Array: return v8LocalValue->IsBigUint64Array(); // 48
case V8ValueInternalType::DataView: return v8LocalValue->IsDataView(); // 49
case V8ValueInternalType::SharedArrayBuffer: return v8LocalValue->IsSharedArrayBuffer(); // 50
case V8ValueInternalType::Proxy: return v8LocalValue->IsProxy(); // 51
case V8ValueInternalType::WasmModuleObject: return v8LocalValue->IsWasmModuleObject(); // 52
case V8ValueInternalType::ModuleNamespaceObject: return v8LocalValue->IsModuleNamespaceObject(); // 53
case Undefined: return v8LocalValue->IsUndefined(); // 0
case Null: return v8LocalValue->IsNull(); // 1
case NullOrUndefined: return v8LocalValue->IsNullOrUndefined(); // 2
case True: return v8LocalValue->IsTrue(); // 3
case False: return v8LocalValue->IsFalse(); // 4
case Name: return v8LocalValue->IsName(); // 5
case String: return v8LocalValue->IsString(); // 6
case Symbol: return v8LocalValue->IsSymbol(); // 7
case Function: return v8LocalValue->IsFunction(); // 8
case Array: return v8LocalValue->IsArray(); // 9
case Object: return v8LocalValue->IsObject(); // 10
case BigInt: return v8LocalValue->IsBigInt(); // 11
case Boolean: return v8LocalValue->IsBoolean(); // 12
case Number: return v8LocalValue->IsNumber(); // 13
case External: return v8LocalValue->IsExternal(); // 14
case Int32: return v8LocalValue->IsInt32(); // 15
case Date: return v8LocalValue->IsDate(); // 16
case ArgumentsObject: return v8LocalValue->IsArgumentsObject(); // 17
case BigIntObject: return v8LocalValue->IsBigIntObject(); // 18
case BooleanObject: return v8LocalValue->IsBooleanObject(); // 19
case NumberObject: return v8LocalValue->IsNumberObject(); // 20
case StringObject: return v8LocalValue->IsStringObject(); // 21
case SymbolObject: return v8LocalValue->IsSymbolObject(); // 22
case NativeError: return v8LocalValue->IsNativeError(); // 23
case RegExp: return v8LocalValue->IsRegExp(); // 24
case AsyncFunction: return v8LocalValue->IsAsyncFunction(); // 25
case GeneratorFunction: return v8LocalValue->IsGeneratorFunction(); // 26
case GeneratorObject: return v8LocalValue->IsGeneratorObject(); // 27
case Promise: return v8LocalValue->IsPromise(); // 28
case Map: return v8LocalValue->IsMap(); // 29
case Set: return v8LocalValue->IsSet(); // 30
case MapIterator: return v8LocalValue->IsMapIterator(); // 31
case SetIterator: return v8LocalValue->IsSetIterator(); // 32
case WeakMap: return v8LocalValue->IsWeakMap(); // 33
case WeakSet: return v8LocalValue->IsWeakSet(); // 34
case ArrayBuffer: return v8LocalValue->IsArrayBuffer(); // 35
case ArrayBufferView: return v8LocalValue->IsArrayBufferView(); // 36
case TypedArray: return v8LocalValue->IsTypedArray(); // 37
case Uint8Array: return v8LocalValue->IsUint8Array(); // 38
case Uint8ClampedArray: return v8LocalValue->IsUint8ClampedArray(); // 39
case Int8Array: return v8LocalValue->IsInt8Array(); // 40
case Uint16Array: return v8LocalValue->IsUint16Array(); // 41
case Int16Array: return v8LocalValue->IsInt16Array(); // 42
case Uint32Array: return v8LocalValue->IsUint32Array(); // 43
case Int32Array: return v8LocalValue->IsInt32Array(); // 44
case Float32Array: return v8LocalValue->IsFloat32Array(); // 45
case Float64Array: return v8LocalValue->IsFloat64Array(); // 46
case BigInt64Array: return v8LocalValue->IsBigInt64Array(); // 47
case BigUint64Array: return v8LocalValue->IsBigUint64Array(); // 48
case DataView: return v8LocalValue->IsDataView(); // 49
case SharedArrayBuffer: return v8LocalValue->IsSharedArrayBuffer(); // 50
case Proxy: return v8LocalValue->IsProxy(); // 51
case WasmModuleObject: return v8LocalValue->IsWasmModuleObject(); // 52
case ModuleNamespaceObject: return v8LocalValue->IsModuleNamespaceObject(); // 53
default:
break;
}
Expand Down
Loading

0 comments on commit 585b319

Please sign in to comment.