Skip to content

dartdevc: toString() crashes on non-Dart object #35952

Open
@rakudrama

Description

@rakudrama

A customer reports the following stack trace when trying to interpolate a GwtException from a GWT app in the page (paths anonymized).

Clearly it should not crash. It seems like the dart.str helper should be hardened.
Opened #35951 to answer the separate question of what it should do.

TypeError: obj[$toString] is not a function
    at Object.dart_library.library.dart.str (https://.../resources/dart_sdk.js)
    at Object.dart_library.library.expression9.temporaryFunction82436245992617 (http://dev_compiler_debugger/last.js:21:17)
    at eval (eval at _onException (https://.../resources/packages/.../exceptions.js), <anonymous>:1:71)
    at eval (eval at _onException (https://.../resources/packages/.../exceptions.js), <anonymous>:1:324)
    at dart_library.library.exception_handler.ConsoleExceptionHandler.new._onException (https://.../resources/packages/.../exceptions.js)
    at _onException.next (<anonymous>)
    at runBody (.../resources/dart_sdk.js)

There is a thread with the title 'Check if object is "NativeJavaScriptObject"' with more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dev-compiler-sdkstatus-blockedBlocked from making progress by another (referenced) issueweb-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions