Files
sdk/tools/dom/templates/html/impl/impl_CompositionEvent.darttemplate
T
Srujan Gaddam 5e74472449 Handle optionals in DOM scripts for NNBD
Optionals were being ignored for some methods and for optionals that
have a default of Undefined or None, they should be marked nullable in
Dart syntax regardless of whether they are in the IDL.

Change-Id: Icc71300dc7d8e06fef640a5ca8d502b093c0580c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134765
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-10 22:26:35 +00:00

32 lines
1.0 KiB
Plaintext

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
part of $LIBRARYNAME;
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
factory $CLASSNAME(String type,
{bool canBubble: false, bool cancelable: false, Window$NULLABLE view,
String$NULLABLE data, String$NULLABLE locale}) {
if (view == null) {
view = window;
}
CompositionEvent e =
document._createEvent("CompositionEvent") $#NULLSAFECAST(as CompositionEvent);
if (Device.isFirefox) {
// Firefox requires the locale parameter that isn't supported elsewhere.
JS('void', '#.initCompositionEvent(#, #, #, #, #, #)',
e, type, canBubble, cancelable, view, data, locale);
} else {
e._initCompositionEvent(type, canBubble, cancelable, view, data);
}
return e;
}
$!MEMBERS
}