AndroidJSCore icon indicating copy to clipboard operation
AndroidJSCore copied to clipboard

Babel polyfill.js

Open bfortunato opened this issue 10 years ago • 43 comments

Hi, Babel polyfill.js evaluation causes an infinite run loop on android. I'm trying to locate the native jni code in your project. Where is?

Tnx for your work!

bfortunato avatar Mar 15 '16 08:03 bfortunato

Hi

The native JNI code lives in the webkit branch: https://github.com/ericwlange/webkit/tree/82034b2c34d7fb11de50d7bc53de6c1aabbc574b/Source/JavaScriptCore/android

Let me know if there is anything I can do to help.

Thanks!

ericwlange avatar Mar 15 '16 10:03 ericwlange

OK Erik, tnx for your answer.

I’ve a problem evaluating babel/polyfill.js. The result is a infinite loop wait at the end of method (some finalize()?) Can you have a try?

Tnx so much for your time!

B

On 15 Mar 2016, at 11:38, Eric Lange [email protected] wrote:

Hi

The native JNI code lives in the webkit branch: https://github.com/ericwlange/webkit/tree/82034b2c34d7fb11de50d7bc53de6c1aabbc574b/Source/JavaScriptCore/android https://github.com/ericwlange/webkit/tree/82034b2c34d7fb11de50d7bc53de6c1aabbc574b/Source/JavaScriptCore/android Let me know if there is anything I can do to help.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-196760379 https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-196760379

bfortunato avatar Mar 15 '16 16:03 bfortunato

I would need to see which implementation of polyfill.js you are using. But this is an npm module, no? AndroidJSCore is an implementation of pure JavaScript. It is not a port of Node, so require or _dereq_ will either not work or not do what you expect. If you are using a browser implementation, then that problem goes away, but it depends on what else it uses. Do you have a link to the exact implementation you are trying to use?

Another suggestion is to try and use the 2.0 release. There has been another raised issue where deadlocking has been reported in 2.1. I haven't had time to debug yet, but this issue did not exist in 2.0.

ericwlange avatar Mar 16 '16 04:03 ericwlange

resolved with polyfill. I’ve another problem.

How to work with byte arrays?

On 16 Mar 2016, at 05:32, Eric Lange [email protected] wrote:

I would need to see which implementation of polyfill.js you are using. But this is an npm module, no? AndroidJSCore is an implementation of pure JavaScript. It is not a port of Node, so require or dereq will either not work or not do what you expect. If you are using a browser implementation, then that problem goes away, but it depends on what else it uses. Do you have a link to the exact implementation you are trying to use?

Another suggestion is to try and use the 2.0 release. There has been another raised issue where deadlocking has been reported in 2.1. I haven't had time to debug yet, but this issue did not exist in 2.0.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-197148252

bfortunato avatar Mar 16 '16 13:03 bfortunato

Typed arrays are completely missed in AndroidJSCore. Thanks for the suggestion. I will add support.

As a workaround, I recommend passing a string using base64 encoding and converting in JS.

Can you post or link polyfill? I would like to debug the hanging issue.

Thanks.

ericwlange avatar Mar 17 '16 09:03 ericwlange

I have created a 2.2 pre-release. Let me know if that has any impact on the hanging problem.

ericwlange avatar May 01 '16 03:05 ericwlange

ok, tnx :)On 01 May 2016, at 05:52, Eric Lange [email protected] wrote:I have created a 2.2 pre-release. Let me know if that has any impact on the hanging problem.—You are receiving this because you authored the thread.Reply to this email directly or view it on GitHub

bfortunato avatar May 01 '16 09:05 bfortunato

This bug is now almost certainly fixed. Please try 2.2-pre2 and see if your problem goes away.

ericwlange avatar May 22 '16 11:05 ericwlange

Tnx

-------- Original message --------From: Eric Lange [email protected] Date: 5/22/16 13:15 (GMT+01:00) To: ericwlange/AndroidJSCore [email protected] Cc: Bruno [email protected], Author [email protected] Subject: Re: [ericwlange/AndroidJSCore] Babel polyfill.js (#14) This bug is now almost certainly fixed. Please try 2.2-pre2 and see if your problem goes away.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

bfortunato avatar May 22 '16 11:05 bfortunato

Hi Eric.

tnx for your job but it doesn’t work. I’m creating a complex mobile framework for ios and android.

iOS works perfectly but on android I’ve a lot of crashes, deadlooks (also with 2.2 pre2) and so on.

I’m trying to build webkit to write my js engine in C++. I’m also trying with V8.

I’ve a strong programming skills and if you want I will help you fixing your great job.

Tnx for all

Bruno

On 22 May 2016, at 13:42, bruno.fortunato [email protected] wrote:

Tnx

-------- Original message -------- From: Eric Lange [email protected] Date: 5/22/16 13:15 (GMT+01:00) To: ericwlange/AndroidJSCore [email protected] Cc: Bruno [email protected], Author [email protected] Subject: Re: [ericwlange/AndroidJSCore] Babel polyfill.js (#14)

This bug is now almost certainly fixed. Please try 2.2-pre2 and see if your problem goes away.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-220826881

bfortunato avatar May 24 '16 11:05 bfortunato

Hi Bruno,

By all means please contribute to the project! What problems are you having specifically? Over the past few weeks I have been writing a more detailed unit testing app, and it has uncovered literally dozens of bugs. I have fixed many of them and am in the process of fixing a few more. Mostly they fall into the categories of memory leaks and inconsistent behavior between JavaScript and Java. I have not experienced any more deadlocks since 2.2 pre2, so if you have something you can share that hangs, I'd be happy to look into it.

Eric

ericwlange avatar May 31 '16 11:05 ericwlange

Please try version 3.0-pre1. I have fixed a zillion stability and memory leak issues. It should resolve your crashes. Please let me know if it solves your issues.

ericwlange avatar Jun 06 '16 03:06 ericwlange

Of course eric.

Tnx so much

On 06 Jun 2016, at 05:38, Eric Lange [email protected] wrote:

Please try version 3.0-pre1. I have fixed a zillion stability and memory leak issues. It should resolve your crashes. Please let me know if it solves your issues.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-223862372, or mute the thread https://github.com/notifications/unsubscribe/AA1HipLkWP2GDw5k8eiGXaWOO6YDg4eeks5qI5YqgaJpZM4Hw0Yv.

bfortunato avatar Jun 06 '16 16:06 bfortunato

Hanging fixed for real in 3.0-pre2. If you continue having problems, be sure to only call JS from outside the UI thread.

ericwlange avatar Jul 12 '16 03:07 ericwlange

Tnx.

I’ll test it soon

On 12 Jul 2016, at 05:30, Eric Lange [email protected] wrote:

Hanging fixed for real in 3.0-pre2. If you continue having problems, be sure to only call JS from outside the UI thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-231928420, or mute the thread https://github.com/notifications/unsubscribe/AA1Hivz8Sv_kDlcB_Qgu6PJNNF_7ydy8ks5qUwpkgaJpZM4Hw0Yv.

bfortunato avatar Jul 12 '16 14:07 bfortunato

Erik, I can’t find packages on new release.

On 12 Jul 2016, at 05:30, Eric Lange [email protected] wrote:

Hanging fixed for real in 3.0-pre2. If you continue having problems, be sure to only call JS from outside the UI thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-231928420, or mute the thread https://github.com/notifications/unsubscribe/AA1Hivz8Sv_kDlcB_Qgu6PJNNF_7ydy8ks5qUwpkgaJpZM4Hw0Yv.

bfortunato avatar Jul 13 '16 15:07 bfortunato

Sorry, I'm not sure I understand. What's the error message?

On Wednesday, July 13, 2016, Bruno [email protected] wrote:

Erik, I can’t find packages on new release.

On 12 Jul 2016, at 05:30, Eric Lange <[email protected] javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

Hanging fixed for real in 3.0-pre2. If you continue having problems, be sure to only call JS from outside the UI thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-231928420>, or mute the thread < https://github.com/notifications/unsubscribe/AA1Hivz8Sv_kDlcB_Qgu6PJNNF_7ydy8ks5qUwpkgaJpZM4Hw0Yv .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-232385608, or mute the thread https://github.com/notifications/unsubscribe/ABIuZFIsebv40NjTgMWCrXcySJsUJQ69ks5qVP-CgaJpZM4Hw0Yv .

ericwlange avatar Jul 14 '16 05:07 ericwlange

I can't find library classes like JSValue, JSContext... The only available class is org.liquidplayer.hemroid.R -------- Original message --------From: Eric Lange [email protected] Date: 7/14/16 07:28 (GMT+01:00) To: ericwlange/AndroidJSCore [email protected] Cc: Bruno [email protected], Author [email protected] Subject: Re: [ericwlange/AndroidJSCore] Babel polyfill.js (#14) Sorry, I'm not sure I understand. What's the error message?

On Wednesday, July 13, 2016, Bruno [email protected] wrote:

Erik, I can’t find packages on new release.

On 12 Jul 2016, at 05:30, Eric Lange <[email protected]

javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

Hanging fixed for real in 3.0-pre2. If you continue having problems, be

sure to only call JS from outside the UI thread.

—

You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub <

https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-231928420>,

or mute the thread <

https://github.com/notifications/unsubscribe/AA1Hivz8Sv_kDlcB_Qgu6PJNNF_7ydy8ks5qUwpkgaJpZM4Hw0Yv

.

—

You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub

https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-232385608,

or mute the thread

https://github.com/notifications/unsubscribe/ABIuZFIsebv40NjTgMWCrXcySJsUJQ69ks5qVP-CgaJpZM4Hw0Yv

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bfortunato avatar Jul 14 '16 06:07 bfortunato

You are looking at 3.0-pre2? Someone else reported this problem with the previous version, but I changed what I thought was causing it, and others are not reporting it. Can you send me your build.gradle?

ericwlange avatar Jul 15 '16 05:07 ericwlange

Here build.gradle

apply plugin: 'com.android.library'

android { compileSdkVersion 23 buildToolsVersion "23.0.2"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}

sourceSets {
    main {
        jni.srcDirs = [] //disable automatic ndk-build
        jniLibs.srcDirs = ['src/main/libs']
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile(name: 'AndroidJSCore-3.0-pre2-release', ext: 'aar') compile 'com.android.support:appcompat-v7:23.1.1' compile ('io.socket:socket.io-client:0.7.0') { exclude group: 'org.json', module: 'json' } compile project(':applica-framework') testCompile 'junit:junit:4.12' androidTestCompile 'junit:junit:4.12'

}

and here a file that use your library

On 15 Jul 2016, at 07:04, Eric Lange [email protected] wrote:

You are looking at 3.0-pre2 https://github.com/ericwlange/AndroidJSCore/releases/tag/3.0-pre2? Someone else reported this problem with the previous version, but I changed what I thought was causing it, and others are not reporting it. Can you send me your build.gradle?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ericwlange/AndroidJSCore/issues/14#issuecomment-232860427, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1HiiqvmJzE3AICeMxkhmZ1YzCnf-dOks5qVxTggaJpZM4Hw0Yv.

bfortunato avatar Jul 15 '16 09:07 bfortunato