expo-modules-core 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 3.0.4 — 2025-08-19
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [Android] Fix invalid array buffer offset in typed arrays. ([#38958](https://github.com/expo/expo/pull/38958) by [@aleqsio](https://github.com/aleqsio))
18
+
13
19
  ## 3.0.3 — 2025-08-18
14
20
 
15
21
  ### 💡 Others
@@ -25,7 +25,7 @@ if (shouldIncludeCompose) {
25
25
  }
26
26
 
27
27
  group = 'host.exp.exponent'
28
- version = '3.0.3'
28
+ version = '3.0.4'
29
29
 
30
30
  def isExpoModulesCoreTests = {
31
31
  Gradle gradle = getGradle()
@@ -75,7 +75,7 @@ android {
75
75
  defaultConfig {
76
76
  consumerProguardFiles 'proguard-rules.pro'
77
77
  versionCode 1
78
- versionName "3.0.3"
78
+ versionName "3.0.4"
79
79
  buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
80
80
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
81
81
 
@@ -57,11 +57,10 @@ jni::local_ref<jni::JByteBuffer> JavaScriptTypedArray::toDirectBuffer() {
57
57
  jsi::Runtime &jsRuntime = runtimeHolder.getJSRuntime();
58
58
 
59
59
  auto byteLength = typedArrayWrapper->byteLength(jsRuntime);
60
- auto byteOffset = typedArrayWrapper->byteOffset(jsRuntime);
61
60
 
62
61
  auto byteBuffer = jni::JByteBuffer::wrapBytes(
63
62
  static_cast<uint8_t *>(typedArrayWrapper->getRawPointer(jsRuntime)),
64
- byteLength - byteOffset
63
+ byteLength
65
64
  );
66
65
 
67
66
  byteBuffer->order(jni::JByteOrder::nativeOrder());
@@ -99,6 +99,14 @@ final class TypedArraysSpec: ExpoSpec {
99
99
  expect(values.filter({ $0 != 0 }).count) >= 1
100
100
  }
101
101
 
102
+ it("returns a correct slice when created from a buffer") {
103
+ let array = try runtime.eval("new Uint8Array(new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).buffer, 3, 5)").asTypedArray()
104
+ expect(array.getProperty("byteOffset").getInt()) == 3
105
+ expect(array.getProperty("byteLength").getInt()) == 5
106
+ expect(array.getProperty("0").getInt()) == 3
107
+ expect(array.getProperty("4").getInt()) == 7
108
+ }
109
+
102
110
  // TODO: Test throwing NotTypedArrayException and ArrayTypeMismatchException
103
111
  }
104
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
@@ -49,5 +49,5 @@
49
49
  "@testing-library/react-native": "^13.2.0",
50
50
  "expo-module-scripts": "^5.0.2"
51
51
  },
52
- "gitHead": "475cdabd3faad56f0e8c4abcaaf21140c01c094f"
52
+ "gitHead": "de2ce610a804a8f3ddcee6ea9474543e81b903bd"
53
53
  }