Skip to content

Commit e33f84d

Browse files
Markzipancommit-bot@chromium.org
authored andcommitted
[dartdevc] Adding custom prototype for MemoryInfo to accommodate Chrome API changes
Chrome Canary no longer exposes window.performance.memory's constructor (it uses Object's instead). This hack lets (window.performance.memory is html.MemoryInfo) evaluate to true. See: #43193 Change-Id: I3c557467c3ea029052aba71f6695f4db0ec65515 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160782 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
1 parent 7e0412a commit e33f84d

File tree

1 file changed

+2
-1
lines changed
  • sdk/lib/_internal/js_dev_runtime/private/ddc_runtime

1 file changed

+2
-1
lines changed

sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ bool polyfill(window) => JS('', '''(() => {
7777
}
7878
if (typeof $window.MemoryInfo == "undefined") {
7979
if (typeof $window.performance.memory != "undefined") {
80-
$window.MemoryInfo = $window.performance.memory.constructor;
80+
$window.MemoryInfo = function () {};
81+
$window.MemoryInfo.prototype = $window.performance.memory.__proto__;
8182
}
8283
}
8384
if (typeof $window.Geolocation == "undefined") {

0 commit comments

Comments
 (0)