Skip to content

Commit 80f84e1

Browse files
srujzscommit-bot@chromium.org
authored andcommitted
Change all fields to native getters/setters
Bug: #40772 Attributes are translated to native getters and setters regardless of NNBD. Some logic was removed for fields that no longer apply due to this change. Change-Id: Ia1a05778ff8c6f082506a1c95a3057a7c5f7f896 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136880 Reviewed-by: Stephen Adams <[email protected]>
1 parent 3ec6ec2 commit 80f84e1

File tree

11 files changed

+4124
-2887
lines changed

11 files changed

+4124
-2887
lines changed

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 3031 additions & 1960 deletions
Large diffs are not rendered by default.

sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,19 @@ class Cursor extends Interceptor {
246246
throw new UnsupportedError("Not supported");
247247
}
248248

249-
final String direction;
249+
String get direction native;
250250

251251
@_annotation_Creates_IDBKey
252252
@_annotation_Returns_IDBKey
253-
final Object key;
253+
Object get key native;
254254

255255
@_annotation_Creates_IDBKey
256256
@_annotation_Returns_IDBKey
257-
final Object primaryKey;
257+
Object get primaryKey native;
258258

259259
@Creates('Null')
260260
@Returns('ObjectStore|Index|Null')
261-
final Object source;
261+
Object get source native;
262262

263263
void advance(int count) native;
264264

@@ -291,7 +291,7 @@ class CursorWithValue extends Cursor {
291291
@JSName('value')
292292
@annotation_Creates_SerializedScriptValue
293293
@annotation_Returns_SerializedScriptValue
294-
final dynamic _get_value;
294+
dynamic get _get_value native;
295295
}
296296
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
297297
// for details. All rights reserved. Use of this source code is governed by a
@@ -402,15 +402,15 @@ class Database extends EventTarget {
402402
static const EventStreamProvider<VersionChangeEvent> versionChangeEvent =
403403
const EventStreamProvider<VersionChangeEvent>('versionchange');
404404

405-
final String name;
405+
String get name native;
406406

407407
@Returns('DomStringList|Null')
408408
@Creates('DomStringList')
409-
final List<String> objectStoreNames;
409+
List<String> get objectStoreNames native;
410410

411411
@Creates('int|String|Null')
412412
@Returns('int|String|Null')
413-
final int version;
413+
int get version native;
414414

415415
void close() native;
416416

@@ -656,15 +656,17 @@ class Index extends Interceptor {
656656
}
657657

658658
@annotation_Creates_SerializedScriptValue
659-
final Object keyPath;
659+
Object get keyPath native;
660660

661-
final bool multiEntry;
661+
bool get multiEntry native;
662662

663-
String name;
663+
String get name native;
664664

665-
final ObjectStore objectStore;
665+
set name(String value) native;
666666

667-
final bool unique;
667+
ObjectStore get objectStore native;
668+
669+
bool get unique native;
668670

669671
@JSName('count')
670672
Request _count(Object key) native;
@@ -725,14 +727,14 @@ class KeyRange extends Interceptor {
725727
}
726728

727729
@annotation_Creates_SerializedScriptValue
728-
final Object lower;
730+
Object get lower native;
729731

730-
final bool lowerOpen;
732+
bool get lowerOpen native;
731733

732734
@annotation_Creates_SerializedScriptValue
733-
final Object upper;
735+
Object get upper native;
734736

735-
final bool upperOpen;
737+
bool get upperOpen native;
736738

737739
@JSName('bound')
738740
static KeyRange bound_(Object lower, Object upper,
@@ -879,18 +881,20 @@ class ObjectStore extends Interceptor {
879881
throw new UnsupportedError("Not supported");
880882
}
881883

882-
final bool autoIncrement;
884+
bool get autoIncrement native;
883885

884886
@Returns('DomStringList|Null')
885887
@Creates('DomStringList')
886-
final List<String> indexNames;
888+
List<String> get indexNames native;
887889

888890
@annotation_Creates_SerializedScriptValue
889-
final Object keyPath;
891+
Object get keyPath native;
892+
893+
String get name native;
890894

891-
String name;
895+
set name(String value) native;
892896

893-
final Transaction transaction;
897+
Transaction get transaction native;
894898

895899
@Returns('Request')
896900
@Creates('Request')
@@ -1024,11 +1028,11 @@ class Observation extends Interceptor {
10241028
throw new UnsupportedError("Not supported");
10251029
}
10261030

1027-
final Object key;
1031+
Object get key native;
10281032

1029-
final String type;
1033+
String get type native;
10301034

1031-
final Object value;
1035+
Object get value native;
10321036
}
10331037
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10341038
// for details. All rights reserved. Use of this source code is governed by a
@@ -1070,11 +1074,11 @@ class ObserverChanges extends Interceptor {
10701074
throw new UnsupportedError("Not supported");
10711075
}
10721076

1073-
final Database database;
1077+
Database get database native;
10741078

1075-
final Object records;
1079+
Object get records native;
10761080

1077-
final Transaction transaction;
1081+
Transaction get transaction native;
10781082
}
10791083
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10801084
// for details. All rights reserved. Use of this source code is governed by a
@@ -1143,19 +1147,19 @@ class Request extends EventTarget {
11431147
static const EventStreamProvider<Event> successEvent =
11441148
const EventStreamProvider<Event>('success');
11451149

1146-
final DomException error;
1150+
DomException get error native;
11471151

1148-
final String readyState;
1152+
String get readyState native;
11491153

11501154
dynamic get result => _convertNativeToDart_IDBAny(this._get_result);
11511155
@JSName('result')
11521156
@Creates('Null')
1153-
final dynamic _get_result;
1157+
dynamic get _get_result native;
11541158

11551159
@Creates('Null')
1156-
final Object source;
1160+
Object get source native;
11571161

1158-
final Transaction transaction;
1162+
Transaction get transaction native;
11591163

11601164
/// Stream of `error` events handled by this [Request].
11611165
Stream<Event> get onError => errorEvent.forTarget(this);
@@ -1230,15 +1234,15 @@ class Transaction extends EventTarget {
12301234
static const EventStreamProvider<Event> errorEvent =
12311235
const EventStreamProvider<Event>('error');
12321236

1233-
final Database db;
1237+
Database get db native;
12341238

1235-
final DomException error;
1239+
DomException get error native;
12361240

1237-
final String mode;
1241+
String get mode native;
12381242

12391243
@Returns('DomStringList|Null')
12401244
@Creates('DomStringList')
1241-
final List<String> objectStoreNames;
1245+
List<String> get objectStoreNames native;
12421246

12431247
void abort() native;
12441248

@@ -1280,17 +1284,17 @@ class VersionChangeEvent extends Event {
12801284
static VersionChangeEvent _create_2(type) =>
12811285
JS('VersionChangeEvent', 'new IDBVersionChangeEvent(#)', type);
12821286

1283-
final String dataLoss;
1287+
String get dataLoss native;
12841288

1285-
final String dataLossMessage;
1289+
String get dataLossMessage native;
12861290

12871291
@Creates('int|String|Null')
12881292
@Returns('int|String|Null')
1289-
final int newVersion;
1293+
int get newVersion native;
12901294

12911295
@Creates('int|String|Null')
12921296
@Returns('int|String|Null')
1293-
final int oldVersion;
1297+
int get oldVersion native;
12941298

12951299
@JSName('target')
12961300
final OpenDBRequest target;

0 commit comments

Comments
 (0)