Skip to content

Commit 884e96d

Browse files
Merge remote-tracking branch 'origin/main' into feat/xcode26.4
# Conflicts: # metadata-generator/src/TypeScript/DefinitionWriter.cpp Co-authored-by: NathanWalker <457187+NathanWalker@users.noreply.github.com>
2 parents f083d35 + aa97bc1 commit 884e96d

17 files changed

Lines changed: 2550 additions & 2374 deletions

File tree

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: 'Checkout Repository'
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@05fe4576374b728f0c523d6a13d64c25081e0803 # v4.8.3
22+
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0

.github/workflows/npm_release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
2222
with:
2323
egress-policy: audit
24-
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
24+
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
2525
with:
2626
xcode-version: ${{env.XCODE_VERSION}}
2727
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -72,12 +72,12 @@ jobs:
7272
- name: Build
7373
run: npm run build-ios
7474
- name: Upload npm package artifact
75-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
75+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
7676
with:
7777
name: npm-package
7878
path: dist/nativescript-ios-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
7979
- name: Upload dSYMs artifact
80-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
80+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
8181
with:
8282
name: NativeScript-dSYMs
8383
path: dist/dSYMs
@@ -90,7 +90,7 @@ jobs:
9090
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
9191
with:
9292
egress-policy: audit
93-
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
93+
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
9494
with:
9595
xcode-version: ${{env.XCODE_VERSION}}
9696
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -128,7 +128,7 @@ jobs:
128128
mkdir -p dist-test
129129
echo TEST_FOLDER=$(pwd)/dist-test >> $GITHUB_ENV
130130
- name: Xcode Tests
131-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
131+
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
132132
# try to run the tests with xcpretty. If it fails then try again without xcpretty twice for better log output
133133
# the xcode tests are a bit flaky and they should never fail on this step, as this step only collects the JS test results as junit xml
134134
with:
@@ -144,7 +144,7 @@ jobs:
144144
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
145145
- name: Archive Test Result Data
146146
if: always()
147-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
147+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
148148
with:
149149
name: test-results
150150
path: ${{env.TEST_FOLDER}}/test_results.xcresult
@@ -169,14 +169,16 @@ jobs:
169169
with:
170170
node-version: 22
171171
registry-url: "https://registry.npmjs.org"
172-
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
172+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
173173
with:
174174
name: npm-package
175175
path: dist
176176
- name: Update npm (required for OIDC trusted publishing)
177177
run: |
178-
npm install -g npm@^11.5.1
179-
npm --version
178+
corepack enable npm
179+
corepack install -g npm@11.5.1
180+
test "$(npm --version)" = "11.5.1"
181+
test "$(npx --version)" = "11.5.1"
180182
- name: Publish package (OIDC trusted publishing)
181183
if: ${{ vars.USE_NPM_TOKEN != 'true' }}
182184
run: |
@@ -220,11 +222,11 @@ jobs:
220222
node-version: 22
221223
- name: Setup
222224
run: npm install
223-
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
225+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
224226
with:
225227
name: npm-package
226228
path: dist
227-
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
229+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
228230
with:
229231
name: NativeScript-dSYMs
230232
path: dist/dSYMs

.github/workflows/pull_request.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Build
1111
runs-on: macos-14
1212
steps:
13-
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
13+
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
1414
with:
1515
xcode-version: ${{env.XCODE_VERSION}}
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -52,12 +52,12 @@ jobs:
5252
- name: Build
5353
run: npm run build-ios
5454
- name: Upload npm package artifact
55-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
55+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5656
with:
5757
name: npm-package
5858
path: dist/nativescript-ios-${{env.NPM_VERSION}}.tgz
5959
- name: Upload dSYMs artifact
60-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
60+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6161
with:
6262
name: NativeScript-dSYMs
6363
path: dist/dSYMs
@@ -66,7 +66,7 @@ jobs:
6666
runs-on: macos-14
6767
needs: build
6868
steps:
69-
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
69+
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
7070
with:
7171
xcode-version: ${{env.XCODE_VERSION}}
7272
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -103,7 +103,7 @@ jobs:
103103
mkdir -p dist-test
104104
echo TEST_FOLDER=$(pwd)/dist-test >> $GITHUB_ENV
105105
- name: Xcode Tests
106-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
106+
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
107107
# try to run the tests with xcpretty. If it fails then try again without xcpretty twice for better log output
108108
# the xcode tests are a bit flaky and they should never fail on this step, as this step only collects the JS test results as junit xml
109109
with:
@@ -119,7 +119,7 @@ jobs:
119119
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
120120
- name: Archive Test Result Data
121121
if: always()
122-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
122+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
123123
with:
124124
name: test-results
125125
path: ${{env.TEST_FOLDER}}/test_results.xcresult

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
63+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif

NativeScript/runtime/ArgConverter.mm

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Foundation/Foundation.h>
22
#include <sstream>
3-
#include <unordered_set>
43
#include "ArgConverter.h"
54
#include "NativeScriptException.h"
65
#include "DictionaryAdapter.h"
@@ -32,20 +31,16 @@
3231

3332
if (wrapper == nullptr) {
3433
// During fast view churn like HMR in development, JS objects can outlive their
35-
// native wrappers briefly. In Debug, avoid a crash and just skip the native call.
34+
// native wrappers briefly. In Debug, throw a catchable JS error instead of crashing.
3635
// In Release, assert so crash reporting can capture unexpected cases.
3736
if (RuntimeConfig.IsDebug) {
3837
const char* selectorStr = meta ? meta->selectorAsString() : "<unknown>";
3938
const char* jsNameStr = meta ? meta->jsName() : "<unknown>";
4039
const char* classNameStr = klass ? class_getName(klass) : "<unknown>";
41-
// Suppress duplicate logs: only log once per class+selector for this process.
42-
static std::unordered_set<std::string> s_logged;
43-
std::string key = std::string(classNameStr) + ":" + selectorStr;
44-
if (s_logged.insert(key).second) {
45-
Log(@"Note: ignore method on non-native receiver (class: %s, selector: %s, jsName: %s, args: %d). Common during HMR.",
46-
classNameStr, selectorStr, jsNameStr, (int)args.Length());
47-
}
48-
return v8::Undefined(isolate);
40+
std::string errMsg = std::string("Cannot call method '") + jsNameStr +
41+
"' on a disposed native object (class: " + classNameStr +
42+
", selector: " + selectorStr + "). This can happen during HMR or fast view churn.";
43+
throw NativeScriptException(isolate, errMsg);
4944
} else {
5045
tns::Assert(false, isolate);
5146
}
@@ -69,14 +64,11 @@
6964
const char* selectorStr = meta ? meta->selectorAsString() : "<unknown>";
7065
const char* jsNameStr = meta ? meta->jsName() : "<unknown>";
7166
const char* classNameStr = klass ? class_getName(klass) : "<unknown>";
72-
// Suppress duplicate logs: only log once per class+selector for this process.
73-
static std::unordered_set<std::string> s_logged;
74-
std::string key = std::string(classNameStr) + ":" + selectorStr;
75-
if (s_logged.insert(key).second) {
76-
Log(@"Note: ignore receiver wrapper type %d (class: %s, selector: %s, jsName: %s). Common during HMR.",
77-
(int)wrapper->Type(), classNameStr, selectorStr, jsNameStr);
78-
}
79-
return v8::Undefined(isolate);
67+
std::string errMsg = std::string("Unexpected receiver wrapper type ") +
68+
std::to_string((int)wrapper->Type()) + " for method '" + jsNameStr +
69+
"' (class: " + classNameStr + ", selector: " + selectorStr +
70+
"). This can happen during HMR or fast view churn.";
71+
throw NativeScriptException(isolate, errMsg);
8072
} else {
8173
tns::Assert(false, isolate);
8274
}

0 commit comments

Comments
 (0)