Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1185)

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2431443002: Use dart:html prefixes (e.g. webkitAudioNode) on other browsers (Closed)
Patch Set: Fix indent Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index d6f3423b7d6980e77c0caddf61502d10298f2b58..f6b12eb4e177eac173181c6cf0b940a1c307368c 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -501,10 +501,13 @@ setBaseClass(derived, base) {
/// Like [setBaseClass] but for generic extension types, e.g. `JSArray<E>`
setExtensionBaseClass(derived, base) {
- // Mark the generic type as an extension type.
- JS('', '#.prototype[#] = #', derived, _extensionType, derived);
- // Link the prototype objects
- JS('', '#.prototype.__proto__ = #.prototype', derived, base);
+ // Mark the generic type as an extension type and link the prototype objects
+ return JS('', '''(() => {
+ if ($base) {
+ $derived.prototype[$_extensionType] = $derived;
+ $derived.prototype.__proto__ = $base.prototype
+ }
+})()''');
}
/// Given a special constructor function that creates a function instances,
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698