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

Unified Diff: mojom/mojom_parser/mojom/user_defined_types.go

Issue 1690453002: Mojom Parser: Populate |serialized_runimte_type_info| field during serialization. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rename variables and new sha1s. 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: mojom/mojom_parser/mojom/user_defined_types.go
diff --git a/mojom/mojom_parser/mojom/user_defined_types.go b/mojom/mojom_parser/mojom/user_defined_types.go
index c0a5c1bf09c62552a09c0953ddc8820c6d1f1cc4..3dd9c5caec73862c537e8331146455457d23dbb4 100644
--- a/mojom/mojom_parser/mojom/user_defined_types.go
+++ b/mojom/mojom_parser/mojom/user_defined_types.go
@@ -9,6 +9,7 @@ import (
"fmt"
"math"
"mojom/mojom_parser/lexer"
+ "sort"
"strings"
)
@@ -145,6 +146,7 @@ func (b *UserDefinedTypeBase) FindReachableTypes() []string {
}
i++
}
+ sort.Strings(typeKeys)
return typeKeys
}
@@ -152,6 +154,9 @@ func (b *UserDefinedTypeBase) FindReachableTypes() []string {
// It performs a depth-first search through the type graph while populating
// |reachableSet| with the UserDefinedTypes encountered during the search.
func findReachableTypes(udt UserDefinedType, reachableSet UserDefinedTypeSet) {
+ if udt == nil {
+ panic("udt is nil")
+ }
if reachableSet.Contains(udt) {
return
}
@@ -186,7 +191,9 @@ func findReachableTypes(udt UserDefinedType, reachableSet UserDefinedTypeSet) {
// There is an edge in the type graph from this interface type to
// the type of a request or response parameter.
findReachableTypes(object.Parameters, reachableSet)
- findReachableTypes(object.ResponseParameters, reachableSet)
+ if object.ResponseParameters != nil {
+ findReachableTypes(object.ResponseParameters, reachableSet)
+ }
}
}
}
« no previous file with comments | « mojo/public/tools/bindings/mojom_parser/bin/mac64/mojom_parser.sha1 ('k') | mojom/mojom_parser/parser/resolution_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698