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

Unified Diff: pkg/analyzer/tool/summary/generate.dart

Issue 1750163003: Separate 'isQualified' flags as List<bool>. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
Index: pkg/analyzer/tool/summary/generate.dart
diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart
index fba35c3a74d27187855ffd5a2733bba5123dce5f..41bfa2933628534327648552846da00d673fa1f8 100644
--- a/pkg/analyzer/tool/summary/generate.dart
+++ b/pkg/analyzer/tool/summary/generate.dart
@@ -124,6 +124,8 @@ class _CodeGenerator {
// List of classes is ok
} else if (_idl.enums.containsKey(type.typeName)) {
// List of enums is ok
+ } else if (type.typeName == 'bool') {
+ // List of booleans is ok
} else if (type.typeName == 'int') {
// List of ints is ok
} else if (type.typeName == 'double') {
@@ -355,6 +357,9 @@ class _CodeGenerator {
break;
}
if (type.isList) {
+ if (typeStr == 'bool') {
+ typeStr = 'ubyte';
Paul Berry 2016/03/01 17:06:19 It would be nice to have a comment here explaining
scheglov 2016/03/01 19:05:34 Done.
+ }
return '[$typeStr]';
} else {
return typeStr;
@@ -606,6 +611,9 @@ class _CodeGenerator {
String itemCode = 'b.index';
String listCode = '$valueName.map((b) => $itemCode).toList()';
writeCode = '$offsetName = fbBuilder.writeListUint8($listCode);';
+ } else if (fieldType.typeName == 'bool') {
+ writeCode =
+ '$offsetName = fbBuilder.writeListBool($valueName);';
} else if (fieldType.typeName == 'int') {
writeCode =
'$offsetName = fbBuilder.writeListUint32($valueName);';
@@ -723,7 +731,9 @@ class _CodeGenerator {
String readCode;
String def = defaultValue(type, false);
if (type.isList) {
- if (typeName == 'int') {
+ if (typeName == 'bool') {
+ readCode = 'const fb.BoolListReader()';
+ } else if (typeName == 'int') {
readCode = 'const fb.Uint32ListReader()';
} else if (typeName == 'double') {
readCode = 'const fb.Float64ListReader()';

Powered by Google App Engine
This is Rietveld 408576698