Make getIfPropertyValueExistsImpl accept a slice (#21554)

Previously it accepted `property: anytype` but now it's `[]const u8`
because that was the only allowed value, so it makes it easier to see
what type it accepts in autocomplete.

Also updates the doc comment, switches it to use ZIG_EXPORT, and updates
the cppbind doc comment
This commit is contained in:
pfg
2025-08-01 19:26:55 -07:00
committed by GitHub
parent 4b39a9b07d
commit 7c4c360431
4 changed files with 10 additions and 16 deletions

View File

@@ -14,7 +14,7 @@ To run manually:
1. **nothrow** - Function that never throws exceptions:
```cpp
[[ZIG_EXPORT(nothrow)]] void hello_world() {
extern "C" [[ZIG_EXPORT(nothrow)]] void hello_world() {
printf("hello world\n");
}
```
@@ -22,7 +22,7 @@ To run manually:
2. **zero_is_throw** - Function returns JSValue, where .zero indicates an exception:
```cpp
[[ZIG_EXPORT(zero_is_throw)]] JSValue create_object(JSGlobalObject* globalThis) {
extern "C" [[ZIG_EXPORT(zero_is_throw)]] JSValue create_object(JSGlobalObject* globalThis) {
auto scope = DECLARE_THROW_SCOPE();
// ...
RETURN_IF_EXCEPTION(scope, {});
@@ -33,7 +33,7 @@ To run manually:
3. **check_slow** - Function that may throw, performs runtime exception checking:
```cpp
[[ZIG_EXPORT(check_slow)]] void process_data(JSGlobalObject* globalThis) {
extern "C" [[ZIG_EXPORT(check_slow)]] void process_data(JSGlobalObject* globalThis) {
auto scope = DECLARE_THROW_SCOPE();
// ...
RETURN_IF_EXCEPTION(scope, );