Skip to content

Commit

Permalink
Change float/doubles -> number (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj authored Jun 16, 2018
1 parent 5cd860f commit fab6f34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion firebase_rules_generator/generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ bool RulesGenerator::GenerateField(const protobuf::FieldDescriptor *field,
case protobuf::FieldDescriptor::TYPE_DOUBLE:
case protobuf::FieldDescriptor::TYPE_FLOAT:
// TODO(rockwood): Do we need anything special for "Nan" or "Infinity"?
vars.insert({"type", "float"});
vars.insert({"type", "number"});
printer.Print(vars, "resource.$name$ is $type$");
break;
case protobuf::FieldDescriptor::TYPE_INT64:
Expand Down
2 changes: 1 addition & 1 deletion testdata/test4.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ function isExampleMessage(resource) {
((!resource.keys().hasAny(['bar'])) || (resource.bar is map)) &&
((!resource.keys().hasAny(['bippity'])) || (resource.bippity is int && resource.bippity >= -2147483648 && resource.bippity <= 2147483647)) &&
((!resource.keys().hasAny(['boppity'])) || (resource.boppity is bool)) &&
((!resource.keys().hasAny(['boo'])) || (resource.boo is float));
((!resource.keys().hasAny(['boo'])) || (resource.boo is number));
}
// @@END_GENERATED_FUNCTIONS@@

0 comments on commit fab6f34

Please sign in to comment.