Debian Codegraph @

closure-library/closure/goog/testing/objectpropertystring.js

raw
1 // Copyright 2009 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Helper for passing property names as string literals in
17 * compiled test code.
18 *
19 */
20
21 goog.setTestOnly('goog.testing.ObjectPropertyString');
22 goog.provide('goog.testing.ObjectPropertyString');
23
24
25
26 /**
27 * Object to pass a property name as a string literal and its containing object
28 * when the JSCompiler is rewriting these names. This should only be used in
29 * test code.
30 *
31 * @param {Object} object The containing object.
32 * @param {Object|string} propertyString Property name as a string literal.
33 * @constructor
34 * @final
35 */
36 goog.testing.ObjectPropertyString = function(object, propertyString) {
37 this.object_ = object;
38 this.propertyString_ = /** @type {string} */ (propertyString);
39 };
40
41
42 /**
43 * @type {Object}
44 * @private
45 */
46 goog.testing.ObjectPropertyString.prototype.object_;
47
48
49 /**
50 * @type {string}
51 * @private
52 */
53 goog.testing.ObjectPropertyString.prototype.propertyString_;
54
55
56 /**
57 * @return {Object} The object.
58 */
59 goog.testing.ObjectPropertyString.prototype.getObject = function() {
60 return this.object_;
61 };
62
63
64 /**
65 * @return {string} The property string.
66 */
67 goog.testing.ObjectPropertyString.prototype.getPropertyString = function() {
68 return this.propertyString_;
69 };