Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit the "assert" routine in the JNI part #221

Closed
atanasovg opened this issue Sep 14, 2015 · 3 comments
Closed

Revisit the "assert" routine in the JNI part #221

atanasovg opened this issue Sep 14, 2015 · 3 comments

Comments

@atanasovg
Copy link
Contributor

At many places within the C++ code we use either the native assert or the ASSERT_XXX macro. We need to revisit the implementation like so:

  • Use the C++ assert, which is disabled for release builds
  • Use conditional error handling when the Runtime needs to fail and go with the ErrorActivity routine - that is, to pass the control back to Java via the NativeScriptRuntime::AppFail method.

Refers to #180 & #196

@atanasovg atanasovg modified the milestones: 1.4.0 (Under review), 1.4.0 Sep 14, 2015
@tailsu
Copy link
Contributor

tailsu commented Oct 6, 2015

This issue breaks https://github.com/chaijs/chai/blob/master/chai.js
The relevant part is:

            /*!
             * Buffer.isBuffer browser shim
             */
            var Buffer;
            try {
                Buffer = require('buffer').Buffer;
            } catch (ex) {
                Buffer = {};
                Buffer.isBuffer = function() {
                    return false;
                }
            }

Instead of entering the catch, the runtime crashes with F/TNS.Native( 4655): require should be called with string parameter.

@atanasovg atanasovg modified the milestones: 1.5.0 (Under Review), 1.4.0 Oct 6, 2015
@slavchev
Copy link

Another one reported by @tailsu

JNI DETECTED ERROR IN APPLICATION: JNI NewString called with pending exception 'com.tns.NativeScriptException' thrown in unknown throw location
try { require(...) } catch(e) {} where it throws SyntaxError

In short, the app crashes if it cannot compile the module JavaScript; it should not

@Plamen5kov
Copy link
Contributor

linked to #277

slavchev pushed a commit that referenced this issue Dec 12, 2015
slavchev pushed a commit that referenced this issue Dec 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants