Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/quickjs/qjs_typedefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import 'package:flutter_js/quickjs/utf8_null_terminated.dart';

class JSContext extends Struct {
@Uint8()
external int? char;
external int char;
}

class JSRuntime extends Struct {
@Uint8()
external int? char;
external int char;
}

class JSValueConst extends Struct {
@Uint8()
external int? char;
external int char;
}

const int JS_EVAL_TYPE_GLOBAL = 0;
Expand Down
4 changes: 2 additions & 2 deletions lib/quickjs/utf8_null_terminated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:ffi/ffi.dart';

class Utf8NullTerminated extends Struct {
@Uint8()
external int? char;
external int char;

static Pointer<Utf8NullTerminated> toUtf8(String s) {
final bytes = Utf8Encoder().convert(s);
Expand All @@ -25,7 +25,7 @@ class Utf8NullTerminated extends Struct {
while (true) {
final char = ptr.elementAt(len++).ref.char;
if (char == 0) break;
bytes.add(char!);
bytes.add(char);
}
return Utf8Decoder().convert(bytes);
}
Expand Down