mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 13:27:24 +00:00
fix crash on android x86
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-08-08 08:16:50
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-10-06 23:18:19
|
||||
* @LastEditTime: 2020-12-02 11:36:40
|
||||
-->
|
||||
|
||||
## 0.1.4
|
||||
|
||||
* fix crash on android x86.
|
||||
|
||||
## 0.1.3
|
||||
|
||||
* fix randomly crash by stack overflow.
|
||||
|
@@ -3,7 +3,7 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-09-06 18:32:45
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-10-07 00:03:41
|
||||
* @LastEditTime: 2020-12-02 11:11:42
|
||||
*/
|
||||
#include "ffi.h"
|
||||
#include <functional>
|
||||
@@ -197,7 +197,6 @@ extern "C"
|
||||
|
||||
DLLEXPORT const char *jsToCString(JSContext *ctx, JSValueConst *val)
|
||||
{
|
||||
JS_ResetStackTop(JS_GetRuntime(ctx));
|
||||
return JS_ToCString(ctx, *val);
|
||||
}
|
||||
|
||||
|
Submodule cxx/quickjs updated: 5e8a1f421c...5143636b2d
@@ -3,7 +3,7 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-08-08 08:16:51
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-10-03 21:37:22
|
||||
* @LastEditTime: 2020-12-02 11:28:06
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:typed_data';
|
||||
@@ -112,7 +112,7 @@ class _TestPageState extends State<TestPage> {
|
||||
setState(() {});
|
||||
}),
|
||||
FlatButton(
|
||||
child: Text("close engine"),
|
||||
child: Text("reset engine"),
|
||||
onPressed: () async {
|
||||
if (engine == null) return;
|
||||
await engine.close();
|
||||
|
@@ -7,42 +7,42 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -56,7 +56,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -82,7 +82,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -108,21 +108,21 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -134,56 +134,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.2"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <=2.11.0-181.0.dev"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.20.0 <2.0.0"
|
||||
|
10
lib/ffi.dart
10
lib/ffi.dart
@@ -3,7 +3,7 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-09-19 10:29:04
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-10-06 23:13:13
|
||||
* @LastEditTime: 2020-12-02 11:14:35
|
||||
*/
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
@@ -199,7 +199,7 @@ final Pointer Function(
|
||||
Pointer Function(
|
||||
Pointer,
|
||||
Pointer<Utf8>,
|
||||
Int64,
|
||||
IntPtr,
|
||||
Pointer<Utf8>,
|
||||
Int32,
|
||||
)>>("jsEval")
|
||||
@@ -330,7 +330,7 @@ final Pointer Function(
|
||||
Pointer Function(
|
||||
Pointer,
|
||||
Pointer<Uint8>,
|
||||
Uint64,
|
||||
IntPtr,
|
||||
)>>("jsNewArrayBufferCopy")
|
||||
.asFunction();
|
||||
|
||||
@@ -487,14 +487,14 @@ String jsToCString(
|
||||
/// uint8_t *jsGetArrayBuffer(JSContext *ctx, size_t *psize, JSValueConst *obj)
|
||||
final Pointer<Uint8> Function(
|
||||
Pointer ctx,
|
||||
Pointer<Int64> psize,
|
||||
Pointer<IntPtr> psize,
|
||||
Pointer val,
|
||||
) jsGetArrayBuffer = qjsLib
|
||||
.lookup<
|
||||
NativeFunction<
|
||||
Pointer<Uint8> Function(
|
||||
Pointer,
|
||||
Pointer<Int64>,
|
||||
Pointer<IntPtr>,
|
||||
Pointer,
|
||||
)>>("jsGetArrayBuffer")
|
||||
.asFunction();
|
||||
|
@@ -3,7 +3,7 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-09-19 22:07:47
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-10-03 23:27:36
|
||||
* @LastEditTime: 2020-12-02 11:14:03
|
||||
*/
|
||||
import 'dart:async';
|
||||
import 'dart:ffi';
|
||||
@@ -212,7 +212,7 @@ dynamic jsToDart(Pointer ctx, Pointer val, {Map<int, dynamic> cache}) {
|
||||
case JSTag.STRING:
|
||||
return jsToCString(ctx, val);
|
||||
case JSTag.OBJECT:
|
||||
Pointer<Int64> psize = allocate<Int64>();
|
||||
Pointer<IntPtr> psize = allocate<IntPtr>();
|
||||
Pointer<Uint8> buf = jsGetArrayBuffer(ctx, psize, val);
|
||||
int size = psize.value;
|
||||
free(psize);
|
||||
|
38
pubspec.lock
38
pubspec.lock
@@ -7,49 +7,49 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.5.0-nullsafety.1"
|
||||
version: "2.5.0-nullsafety.3"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.3"
|
||||
version: "1.1.0-nullsafety.5"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.15.0-nullsafety.3"
|
||||
version: "1.15.0-nullsafety.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
ffi:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -73,21 +73,21 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.12.10-nullsafety.1"
|
||||
version: "0.12.10-nullsafety.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.6"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.1"
|
||||
version: "1.8.0-nullsafety.3"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -99,56 +99,56 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.8.0-nullsafety.2"
|
||||
version: "1.8.0-nullsafety.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.10.0-nullsafety.2"
|
||||
version: "1.10.0-nullsafety.6"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
version: "2.1.0-nullsafety.3"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
version: "1.1.0-nullsafety.3"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
version: "1.2.0-nullsafety.3"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.2.19-nullsafety.2"
|
||||
version: "0.2.19-nullsafety.6"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0-nullsafety.3"
|
||||
version: "1.3.0-nullsafety.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.3"
|
||||
version: "2.1.0-nullsafety.5"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <=2.11.0-181.0.dev"
|
||||
dart: ">=2.12.0-0.0 <3.0.0"
|
||||
flutter: ">=1.20.0 <2.0.0"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
name: flutter_qjs
|
||||
description: This plugin is a simple js engine for flutter using the `quickjs` project. Plugin currently supports all the platforms except web!
|
||||
version: 0.1.3
|
||||
version: 0.1.4
|
||||
homepage: https://github.com/ekibun/flutter_qjs
|
||||
|
||||
environment:
|
||||
|
Reference in New Issue
Block a user