Repository: flutter
Issue: Flutter Web: JavaScript history.pushState raises an exception in Release Build.
Labels: c: crash,dependency: dart,platform-web,a: release,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-web,triaged-web

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Clone repo: https://github.com/gladimdim/push_history_bug.

2. Switch to Flutter beta channel & enable web
```
flutter channel beta
flutter upgrade
flutter doctor
flutter config --enable-web
```
3. Run the *debug* mode:
```
flutter run -d chrome
```
It will show an app with the button. Clicking on the button will add 'google.com' at the end of the URL in address bar. js.history.pushState works OK in debug mode.

4. Run the *release* build :
```
flutter run --release -d chrome
```

5. Press the red button multiple times.

**Expected results:** the url is updated via js.history.pushState bindings from dart:js. Each button click adds 'google.com' at the end of the URL in the address bar.

**Actual results:**: the url is not updated. Exception is thrown in the Chrome console: Another exception was thrown: Instance of 'minified:ar<void>'

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
flutter run --verbose -d chrome --release
[  +28 ms] executing: [/Users/i501633/progs/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +48 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] fabeb2a16f1d008ab8230f450c49141d35669798
[        ] executing: [/Users/i501633/progs/flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +39 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.14.6-0-gfabeb2a16
[   +7 ms] executing: [/Users/i501633/progs/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/Users/i501633/progs/flutter/] git ls-remote --get-url origin
[   +9 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +45 ms] executing: [/Users/i501633/progs/flutter/] git rev-parse --abbrev-ref HEAD
[  +11 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[   +6 ms] executing: sw_vers -productName
[  +16 ms] Exit code 0 from: sw_vers -productName
[        ] Mac OS X
[        ] executing: sw_vers -productVersion
[  +16 ms] Exit code 0 from: sw_vers -productVersion
[        ] 10.15.3
[        ] executing: sw_vers -buildVersion
[  +16 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 19D76
[  +33 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +36 ms] executing: /Users/i501633/Library/Android/sdk/platform-tools/adb devices -l
[   +7 ms] Exit code 0 from: /Users/i501633/Library/Android/sdk/platform-tools/adb devices -l
[        ] List of devices attached
[  +15 ms] executing: /Users/i501633/progs/flutter/bin/cache/artifacts/libimobiledevice/idevice_id -h
[  +63 ms] executing: /usr/bin/xcode-select --print-path
[   +8 ms] Exit code 0 from: /usr/bin/xcode-select --print-path
[        ] /Applications/Xcode.app/Contents/Developer
[        ] executing: /usr/bin/xcodebuild -version
[ +595 ms] Exit code 0 from: /usr/bin/xcodebuild -version
[   +3 ms] Xcode 11.3.1
           Build version 11C504
[   +4 ms] /usr/bin/xcrun simctl list --json devices
[ +113 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +216 ms] Generating /Users/i501633/projects/history_push_error/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +117 ms] Launching lib/main.dart on Chrome in release mode...
[        ] Building application for the web...
[ +185 ms] Generating /Users/i501633/projects/history_push_error/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[   +4 ms] Compiling lib/main.dart for the Web...
[  +13 ms] Initializing file store
[  +10 ms] Done initializing file store
[  +72 ms] invalidated build due to missing files: /Users/i501633/projects/history_push_error/packages/flutter_tools/lib/src/build_system/targets/web.dart
[  +16 ms] web_entrypoint: Starting due to {InvalidatedReason.inputMissing}
[   +2 ms] web_entrypoint: Complete
[+1827 ms] dart2js: Starting due to {InvalidatedReason.inputChanged}
[+17424 ms] dart2js: Complete
[  +66 ms] web_release_bundle: Starting due to {InvalidatedReason.inputChanged}
[  +63 ms] web_release_bundle: Complete
[  +72 ms] web_service_worker: Starting due to {InvalidatedReason.inputChanged}
[  +31 ms] web_service_worker: Complete
[   +2 ms] Persisting file store
[   +5 ms] Done persisting file store
[  +15 ms] Compiling lib/main.dart for the Web... (completed in 19.6s)
[  +13 ms] Building application for the web... (completed in 19.8s)
[ +874 ms] Warning: Flutter's support for web development is not stable yet and hasn't
[        ] been thoroughly tested in production environments.
[        ] For more information see https://flutter.dev/web
[        ] 🔥  To hot restart changes while running, press "r". To hot restart (and refresh the browser), press "R".
[   +2 ms] For a more detailed help message, press "h". To quit, press "q".
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
flutter analyze
Analyzing history_push_error...                                         

   info • Avoid using web-only libraries outside Flutter web plugin packages • lib/main.dart:3:1 • avoid_web_libraries_in_flutter

1 issue found. (ran in 8.2s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
[✓] Flutter (Channel beta, v1.14.6, on Mac OS X 10.15.3 19D76, locale en)
    • Flutter version 1.14.6 at /Users/i501633/progs/flutter
    • Framework revision fabeb2a16f (9 days ago), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/i501633/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.0

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 80.0.3987.87
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!
```

</details>