| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 define("mojo/public/js/validator", [ | 5 define("mojo/public/js/validator", [ |
| 6 "mojo/public/js/codec", | 6 "mojo/public/js/codec", |
| 7 "mojo/public/js/interface_types", | 7 "mojo/public/js/interface_types", |
| 8 ], function(codec, types) { | 8 ], function(codec, types) { |
| 9 | 9 |
| 10 var validationError = { | 10 var validationError = { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 cls === codec.NullableAssociatedInterfacePtrInfo; | 102 cls === codec.NullableAssociatedInterfacePtrInfo; |
| 103 } | 103 } |
| 104 | 104 |
| 105 function isAssociatedInterfaceRequestClass(cls) { | 105 function isAssociatedInterfaceRequestClass(cls) { |
| 106 return cls === codec.AssociatedInterfaceRequest || | 106 return cls === codec.AssociatedInterfaceRequest || |
| 107 cls === codec.NullableAssociatedInterfaceRequest; | 107 cls === codec.NullableAssociatedInterfaceRequest; |
| 108 } | 108 } |
| 109 | 109 |
| 110 function isNullable(type) { | 110 function isNullable(type) { |
| 111 return type === codec.NullableString || type === codec.NullableHandle || | 111 return type === codec.NullableString || type === codec.NullableHandle || |
| 112 type === codec.NullableAssociatedInterfacePtrInfo || |
| 113 type === codec.NullableAssociatedInterfaceRequest || |
| 112 type === codec.NullableInterface || | 114 type === codec.NullableInterface || |
| 113 type === codec.NullableInterfaceRequest || | 115 type === codec.NullableInterfaceRequest || |
| 114 type instanceof codec.NullableArrayOf || | 116 type instanceof codec.NullableArrayOf || |
| 115 type instanceof codec.NullablePointerTo; | 117 type instanceof codec.NullablePointerTo; |
| 116 } | 118 } |
| 117 | 119 |
| 118 function Validator(message) { | 120 function Validator(message) { |
| 119 this.message = message; | 121 this.message = message; |
| 120 this.offset = 0; | 122 this.offset = 0; |
| 121 this.handleIndex = 0; | 123 this.handleIndex = 0; |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 677 |
| 676 var exports = {}; | 678 var exports = {}; |
| 677 exports.validationError = validationError; | 679 exports.validationError = validationError; |
| 678 exports.Validator = Validator; | 680 exports.Validator = Validator; |
| 679 exports.ValidationErrorObserverForTesting = ValidationErrorObserverForTesting; | 681 exports.ValidationErrorObserverForTesting = ValidationErrorObserverForTesting; |
| 680 exports.reportValidationError = reportValidationError; | 682 exports.reportValidationError = reportValidationError; |
| 681 exports.isTestingMode = isTestingMode; | 683 exports.isTestingMode = isTestingMode; |
| 682 exports.clearTestingMode = clearTestingMode; | 684 exports.clearTestingMode = clearTestingMode; |
| 683 return exports; | 685 return exports; |
| 684 }); | 686 }); |
| OLD | NEW |