yellow-brick-road 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/README.rst +42 -20
  2. data/lib/generators/templates/yellow_brick_road.rb.erb +19 -0
  3. data/lib/generators/yellow_brick_road/install_generator.rb +14 -0
  4. data/lib/yellow-brick-road/config.rb +41 -8
  5. data/lib/yellow-brick-road/directive_processor.rb +6 -5
  6. data/lib/yellow-brick-road/engine.rb +2 -3
  7. data/lib/yellow-brick-road/soy_processor.rb +1 -1
  8. data/lib/yellow-brick-road/version.rb +1 -1
  9. data/test/dummy/app/assets/javascripts/closure-deps.js +1 -1
  10. data/test/dummy/config/initializers/yellow_brick_road.rb +18 -1
  11. data/test/dummy/log/development.log +2208 -0
  12. data/test/dummy/tmp/cache/assets/C33/E00/sprockets%2F50c54266987e056bca666f8951752841 +2556 -0
  13. data/test/dummy/tmp/cache/assets/C48/990/sprockets%2F182c7921a46c3b8603c7f5595a111407 +823 -0
  14. data/test/dummy/tmp/cache/assets/C53/B40/sprockets%2F48cf0c035092dc945559526a279061c6 +204 -0
  15. data/test/dummy/tmp/cache/assets/C60/DB0/sprockets%2F3f00684578f2a3246581db667309ed89 +187 -0
  16. data/test/dummy/tmp/cache/assets/C60/E40/sprockets%2F3c5422f721521f492a5f02ca00b70009 +457 -0
  17. data/test/dummy/tmp/cache/assets/C73/DE0/sprockets%2F21f1f4574326846114a3c106873cebc3 +0 -0
  18. data/test/dummy/tmp/cache/assets/C7E/9F0/sprockets%2F89862076204c62c4593ac20de32da909 +4 -4
  19. data/test/dummy/tmp/cache/assets/C80/6F0/sprockets%2F56459a0713f8610d7d261f8be93073a2 +115 -0
  20. data/test/dummy/tmp/cache/assets/C8D/E10/sprockets%2F34b84bc4732937f885707002eda3896e +511 -0
  21. data/test/dummy/tmp/cache/assets/C93/CB0/sprockets%2F539b403b24833ca478a6f5877f37687c +239 -0
  22. data/test/dummy/tmp/cache/assets/C9A/C70/sprockets%2F10933dc6d342f604514713510b9ef0ab +806 -0
  23. data/test/dummy/tmp/cache/assets/CA0/7C0/sprockets%2Ff591bc0af8f085501241305c04907d3e +590 -0
  24. data/test/dummy/tmp/cache/assets/CA1/4A0/sprockets%2F5a9ad311e7d225b530b597041714b1e9 +2539 -0
  25. data/test/dummy/tmp/cache/assets/CA7/310/sprockets%2F45664cf816315200b574e029fde6f10a +0 -0
  26. data/test/dummy/tmp/cache/assets/CA7/A80/sprockets%2F1f32590957635a5a4f35442bc22f4ca4 +0 -0
  27. data/test/dummy/tmp/cache/assets/CAE/1D0/sprockets%2F2e62c7733d38a817a1532a744c6287bd +72 -0
  28. data/test/dummy/tmp/cache/assets/CB2/3C0/sprockets%2F9c35c290501a896b82c31448a39f3d5d +142 -0
  29. data/test/dummy/tmp/cache/assets/CB3/F20/sprockets%2F558b00e493fb501f7d95761e7eb40273 +2539 -0
  30. data/test/dummy/tmp/cache/assets/CBE/550/sprockets%2Fd680cac830e0b3408ba910f0b0421147 +2 -2
  31. data/test/dummy/tmp/cache/assets/CCD/480/sprockets%2Ffe7e11511634a2d03e1a20980b4593cf +0 -0
  32. data/test/dummy/tmp/cache/assets/CD0/080/sprockets%2Ffd5cbb87741244521d013d11c55573fa +204 -0
  33. data/test/dummy/tmp/cache/assets/CD2/020/sprockets%2Ff97740ba22118a2c91e992aac041843b +811 -0
  34. data/test/dummy/tmp/cache/assets/CD8/D90/sprockets%2F55dd841661d646f0024261a08ecf8ec0 +823 -0
  35. data/test/dummy/tmp/cache/assets/CE3/0D0/sprockets%2F301f97a178fd839a81bd663a6e22b616 +811 -0
  36. data/test/dummy/tmp/cache/assets/CE4/330/sprockets%2Fbd23466639af99164ab8e1c93721f14b +127 -0
  37. data/test/dummy/tmp/cache/assets/CE6/8A0/sprockets%2F3c0e7c5fa31563c8e820d6771e09918d +103 -0
  38. data/test/dummy/tmp/cache/assets/CEB/120/sprockets%2F857a0dde6829f7a27b93a840e1c60469 +522 -0
  39. data/test/dummy/tmp/cache/assets/CEE/CF0/sprockets%2F376f94b987d8156056c4e1d38ec06bf0 +0 -0
  40. data/test/dummy/tmp/cache/assets/CF2/C10/sprockets%2Fc64ef8a9dd0a1c3101d662750105c11a +806 -0
  41. data/test/dummy/tmp/cache/assets/CF3/CD0/sprockets%2F4bb42a5a6b504190f10d20b1c5f93d54 +1529 -0
  42. data/test/dummy/tmp/cache/assets/CF6/890/sprockets%2F36007a87f140155b5a04f2ca6b262dcc +494 -0
  43. data/test/dummy/tmp/cache/assets/CF6/9D0/sprockets%2F34b7199e9d33994c8ec7a442d60ca985 +173 -0
  44. data/test/dummy/tmp/cache/assets/CFA/A90/sprockets%2F901ba405a6d6747f6412ed4d0e0ac620 +256 -0
  45. data/test/dummy/tmp/cache/assets/CFC/E70/sprockets%2F8ee639668b5f0e629fbe0d62d1394689 +173 -0
  46. data/test/dummy/tmp/cache/assets/D04/1B0/sprockets%2F418f2b3b6b08b320f6db268a0991c54c +0 -0
  47. data/test/dummy/tmp/cache/assets/D05/920/sprockets%2F909507434dcc270db4853e4c147f0aac +5 -4
  48. data/test/dummy/tmp/cache/assets/D07/DB0/sprockets%2F0c17d7dac64290e385c91eb6f1570b31 +511 -0
  49. data/test/dummy/tmp/cache/assets/D07/EE0/sprockets%2F4999982b09e0b786894fce44f5d783cc +1371 -0
  50. data/test/dummy/tmp/cache/assets/D09/380/sprockets%2F14383e18fa2faac6b561a29d8e132863 +0 -0
  51. data/test/dummy/tmp/cache/assets/D0D/200/sprockets%2F545a7e34cce1d4272d83d58fd4215d42 +1277 -0
  52. data/test/dummy/tmp/cache/assets/D0E/870/sprockets%2F84996444f4f1f3fdc0248131cfb1a3b6 +794 -0
  53. data/test/dummy/tmp/cache/assets/D15/F60/sprockets%2Fa28394e3f80365b5bc86794dd46daa22 +0 -0
  54. data/test/dummy/tmp/cache/assets/D18/950/sprockets%2Fcf650d67c5d431ffdb38552e562299b2 +474 -0
  55. data/test/dummy/tmp/cache/assets/D18/E10/sprockets%2Fec7c58f640556b401fcd66528352dc9d +474 -0
  56. data/test/dummy/tmp/cache/assets/D20/660/sprockets%2F0d2875475ced01df962f3d758cda7792 +103 -0
  57. data/test/dummy/tmp/cache/assets/D22/AB0/sprockets%2F0b08e7f81651aaf739a93d61ae99779c +283 -0
  58. data/test/dummy/tmp/cache/assets/D2E/B20/sprockets%2Feed5412a17a52b1a335925e2af1f75d3 +0 -0
  59. data/test/dummy/tmp/cache/assets/D36/700/sprockets%2Fd219bf9db2eacc105bb294755093a437 +505 -0
  60. data/test/dummy/tmp/cache/assets/D3B/A10/sprockets%2Fcf38b51682d84a04da7b8a7313de52c6 +207 -0
  61. data/test/dummy/tmp/cache/assets/D3C/0E0/sprockets%2Fe9d7aba138d602c4a6ac701bc9615977 +505 -0
  62. data/test/dummy/tmp/cache/assets/D3E/FF0/sprockets%2F6bd8ccd3e02f397c20f349d5c0960e51 +0 -0
  63. data/test/dummy/tmp/cache/assets/D41/B30/sprockets%2Fba1b93913dd01d83ac9a96df334456f8 +0 -0
  64. data/test/dummy/tmp/cache/assets/D41/DA0/sprockets%2Fe8d00810698a9fcee032022fefd084f7 +0 -0
  65. data/test/dummy/tmp/cache/assets/D44/CF0/sprockets%2Ffa31a45f04884493c909c5a67fcbdf23 +1371 -0
  66. data/test/dummy/tmp/cache/assets/D47/BE0/sprockets%2F0b5ebdf6dec160a264698e7f745061e8 +142 -0
  67. data/test/dummy/tmp/cache/assets/D4C/F30/sprockets%2Ff90155c10f59a3fe44959ac09bf817fe +2556 -0
  68. data/test/dummy/tmp/cache/assets/D4E/7C0/sprockets%2Ff01b58512d01eda23fd5cb23a2b28b60 +1529 -0
  69. data/test/dummy/tmp/cache/assets/D4E/860/sprockets%2F86eed0c77c47d0970345bbabb58d8939 +1277 -0
  70. data/test/dummy/tmp/cache/assets/D4E/C30/sprockets%2F52420c10c73ca310d026565eafdadb4e +1545 -0
  71. data/test/dummy/tmp/cache/assets/D4E/F60/sprockets%2F9893a3c5aeb1a9e77469f4751b4d3c3f +115 -0
  72. data/test/dummy/tmp/cache/assets/D4F/E60/sprockets%2F17ee65de1f78c3dd5c165a9867e810b6 +165 -0
  73. data/test/dummy/tmp/cache/assets/D57/0D0/sprockets%2Fa29e6e8106d9d5ed1e2889126cfbf877 +300 -0
  74. data/test/dummy/tmp/cache/assets/D5C/650/sprockets%2Fe1c381da3cc213a639e956ae3315a2bd +607 -0
  75. data/test/dummy/tmp/cache/assets/D61/860/sprockets%2Fbf032a3b4aad2c2e25704e65c966cf45 +794 -0
  76. data/test/dummy/tmp/cache/assets/D63/B20/sprockets%2F31fc70ce66bb80fb9421be34eb3b0287 +0 -0
  77. data/test/dummy/tmp/cache/assets/D64/D60/sprockets%2Fa544ea03bf0a45948a053ba76ec2a79f +239 -0
  78. data/test/dummy/tmp/cache/assets/D6B/F90/sprockets%2F66636712ecb1fcc777dccf7643a0e1b1 +127 -0
  79. data/test/dummy/tmp/cache/assets/D6E/AD0/sprockets%2Fc91cdc6a72c729d7a64119198b3d2eab +0 -0
  80. data/test/dummy/tmp/cache/assets/D6F/140/sprockets%2F9ddc51f4388dd5243a28dba1ce47572b +53 -0
  81. data/test/dummy/tmp/cache/assets/D72/800/sprockets%2F92baa375d54e16fe0a5c7f079a1ce992 +165 -0
  82. data/test/dummy/tmp/cache/assets/D74/220/sprockets%2F3f888bda53179cb945eab35fbd31a708 +53 -0
  83. data/test/dummy/tmp/cache/assets/D78/5F0/sprockets%2F638ed6af667d4fc5147f72ff34aa2d33 +0 -0
  84. data/test/dummy/tmp/cache/assets/D7D/640/sprockets%2F95a7c5580f957c31e1ab9d0773ed5fde +607 -0
  85. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +6 -5
  86. data/test/dummy/tmp/cache/assets/D89/020/sprockets%2Fa06df6166e70324e712e54b1cafca0ae +187 -0
  87. data/test/dummy/tmp/cache/assets/D8A/9F0/sprockets%2Fc06547ca33ee3d03be14ce045ae1c9e2 +207 -0
  88. data/test/dummy/tmp/cache/assets/D9E/B80/sprockets%2F9561df1d45c7ff4aa8ac3e2df0c99121 +0 -0
  89. data/test/dummy/tmp/cache/assets/DA3/F30/sprockets%2Fe015d6ccdfcf022e47c83d7906f728ae +457 -0
  90. data/test/dummy/tmp/cache/assets/DAE/190/sprockets%2F433c7b21968be8d1f9bfdbdf7a637c57 +0 -0
  91. data/test/dummy/tmp/cache/assets/DB3/600/sprockets%2F9b70ae73f15ba693886eeef4eb5d6c75 +0 -0
  92. data/test/dummy/tmp/cache/assets/DB4/510/sprockets%2F29cdae8e29c88fd9ddbd4831419560fe +1260 -0
  93. data/test/dummy/tmp/cache/assets/DC1/4A0/sprockets%2F0b63dfcf163f2faeb612724eb4545bcc +1354 -0
  94. data/test/dummy/tmp/cache/assets/DC4/C10/sprockets%2Fcf48f4cbad3db33146eab4c577c1d209 +300 -0
  95. data/test/dummy/tmp/cache/assets/DC4/CA0/sprockets%2Fd0da8a60ea4dc16b9fd3e2a50d88633c +0 -0
  96. data/test/dummy/tmp/cache/assets/DC7/8C0/sprockets%2F1ad68dcc9ef598d3811ba2ac5c0ea182 +1354 -0
  97. data/test/dummy/tmp/cache/assets/DC7/C00/sprockets%2Fba755ff3a81c3192f0e45a4f7c0c7dcb +0 -0
  98. data/test/dummy/tmp/cache/assets/DCA/760/sprockets%2F717c4cea10bf601090ffdfe4e668e4cb +283 -0
  99. data/test/dummy/tmp/cache/assets/DCA/DE0/sprockets%2F51dcced9ec2b3cd4b1cc2949f860c361 +590 -0
  100. data/test/dummy/tmp/cache/assets/DD7/E70/sprockets%2F2595d8c8d1d5f4deb096247fb3bfc7ab +256 -0
  101. data/test/dummy/tmp/cache/assets/DE1/9D0/sprockets%2F8befd77af580ee16ec42ec95b1766ff3 +1545 -0
  102. data/test/dummy/tmp/cache/assets/E00/D80/sprockets%2F9debc27161f7bccf2d84a36b8c36c4bf +522 -0
  103. data/test/dummy/tmp/cache/assets/E00/E60/sprockets%2Fac159b94b0a6d621e4f6cde9b4de87bb +0 -0
  104. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  105. data/test/dummy/tmp/cache/assets/E1B/D00/sprockets%2F886dff4afe55f9d3f8abe434f2689add +72 -0
  106. data/test/dummy/tmp/cache/assets/E1B/F20/sprockets%2Fa4bbc04eb83ebf94fd8134c3abd220dd +494 -0
  107. data/test/dummy/tmp/cache/assets/E71/0C0/sprockets%2F5ffdc0daa0a1f9638c787897ceefcdee +1260 -0
  108. metadata +186 -10
  109. data/test/dummy/tmp/pids/server.pid +0 -1
@@ -0,0 +1,1529 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325538161.451329: @value{ I" length:EFi{�I" digest;
2
+ F"%1ded7f6f073498cafeffde051bba9f41I" source;
3
+ FI"{�// Copyright 2006 The Closure Library Authors. All Rights Reserved.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS-IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ /**
18
+ * @fileoverview Bootstrap for the Google JS Library (Closure).
19
+ *
20
+ * In uncompiled mode base.js will write out Closure's deps file, unless the
21
+ * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to
22
+ * include their own deps file(s) from different locations.
23
+ *
24
+ */
25
+
26
+
27
+ /**
28
+ * @define {boolean} Overridden to true by the compiler when --closure_pass
29
+ * or --mark_as_compiled is specified.
30
+ */
31
+
32
+ var COMPILED = false;
33
+
34
+
35
+ /**
36
+ * Base namespace for the Closure library. Checks to see goog is
37
+ * already defined in the current scope before assigning to prevent
38
+ * clobbering if base.js is loaded more than once.
39
+ *
40
+ * @const
41
+ */
42
+ var goog = goog || {}; // Identifies this file as the Closure base.
43
+
44
+
45
+ /**
46
+ * Reference to the global context. In most cases this will be 'window'.
47
+ */
48
+ goog.global = this;
49
+
50
+
51
+ /**
52
+ * @define {boolean} DEBUG is provided as a convenience so that debugging code
53
+ * that should not be included in a production js_binary can be easily stripped
54
+ * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most
55
+ * toString() methods should be declared inside an "if (goog.DEBUG)" conditional
56
+ * because they are generally used for debugging purposes and it is difficult
57
+ * for the JSCompiler to statically determine whether they are used.
58
+ */
59
+ goog.DEBUG = true;
60
+
61
+
62
+ /**
63
+ * @define {string} LOCALE defines the locale being used for compilation. It is
64
+ * used to select locale specific data to be compiled in js binary. BUILD rule
65
+ * can specify this value by "--define goog.LOCALE=<locale_name>" as JSCompiler
66
+ * option.
67
+ *
68
+ * Take into account that the locale code format is important. You should use
69
+ * the canonical Unicode format with hyphen as a delimiter. Language must be
70
+ * lowercase, Language Script - Capitalized, Region - UPPERCASE.
71
+ * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.
72
+ *
73
+ * See more info about locale codes here:
74
+ * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers
75
+ *
76
+ * For language codes you should use values defined by ISO 693-1. See it here
77
+ * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from
78
+ * this rule: the Hebrew language. For legacy reasons the old code (iw) should
79
+ * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.
80
+ */
81
+ goog.LOCALE = 'en'; // default to en
82
+
83
+
84
+ /**
85
+ * Creates object stubs for a namespace. The presence of one or more
86
+ * goog.provide() calls indicate that the file defines the given
87
+ * objects/namespaces. Build tools also scan for provide/require statements
88
+ * to discern dependencies, build dependency files (see deps.js), etc.
89
+ * @see goog.require
90
+ * @param {string} name Namespace provided by this file in the form
91
+ * "goog.package.part".
92
+ */
93
+ goog.provide = function(name) {
94
+ if (!COMPILED) {
95
+ // Ensure that the same namespace isn't provided twice. This is intended
96
+ // to teach new developers that 'goog.provide' is effectively a variable
97
+ // declaration. And when JSCompiler transforms goog.provide into a real
98
+ // variable declaration, the compiled JS should work the same as the raw
99
+ // JS--even when the raw JS uses goog.provide incorrectly.
100
+ if (goog.isProvided_(name)) {
101
+ throw Error('Namespace "' + name + '" already declared.');
102
+ }
103
+ delete goog.implicitNamespaces_[name];
104
+
105
+ var namespace = name;
106
+ while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {
107
+ if (goog.getObjectByName(namespace)) {
108
+ break;
109
+ }
110
+ goog.implicitNamespaces_[namespace] = true;
111
+ }
112
+ }
113
+
114
+ goog.exportPath_(name);
115
+ };
116
+
117
+
118
+ /**
119
+ * Marks that the current file should only be used for testing, and never for
120
+ * live code in production.
121
+ * @param {string=} opt_message Optional message to add to the error that's
122
+ * raised when used in production code.
123
+ */
124
+ goog.setTestOnly = function(opt_message) {
125
+ if (COMPILED && !goog.DEBUG) {
126
+ opt_message = opt_message || '';
127
+ throw Error('Importing test-only code into non-debug environment' +
128
+ opt_message ? ': ' + opt_message : '.');
129
+ }
130
+ };
131
+
132
+
133
+ if (!COMPILED) {
134
+
135
+ /**
136
+ * Check if the given name has been goog.provided. This will return false for
137
+ * names that are available only as implicit namespaces.
138
+ * @param {string} name name of the object to look for.
139
+ * @return {boolean} Whether the name has been provided.
140
+ * @private
141
+ */
142
+ goog.isProvided_ = function(name) {
143
+ return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name);
144
+ };
145
+
146
+ /**
147
+ * Namespaces implicitly defined by goog.provide. For example,
148
+ * goog.provide('goog.events.Event') implicitly declares
149
+ * that 'goog' and 'goog.events' must be namespaces.
150
+ *
151
+ * @type {Object}
152
+ * @private
153
+ */
154
+ goog.implicitNamespaces_ = {};
155
+ }
156
+
157
+
158
+ /**
159
+ * Builds an object structure for the provided namespace path,
160
+ * ensuring that names that already exist are not overwritten. For
161
+ * example:
162
+ * "a.b.c" -> a = {};a.b={};a.b.c={};
163
+ * Used by goog.provide and goog.exportSymbol.
164
+ * @param {string} name name of the object that this file defines.
165
+ * @param {*=} opt_object the object to expose at the end of the path.
166
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
167
+ * is |goog.global|.
168
+ * @private
169
+ */
170
+ goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {
171
+ var parts = name.split('.');
172
+ var cur = opt_objectToExportTo || goog.global;
173
+
174
+ // Internet Explorer exhibits strange behavior when throwing errors from
175
+ // methods externed in this manner. See the testExportSymbolExceptions in
176
+ // base_test.html for an example.
177
+ if (!(parts[0] in cur) && cur.execScript) {
178
+ cur.execScript('var ' + parts[0]);
179
+ }
180
+
181
+ // Certain browsers cannot parse code in the form for((a in b); c;);
182
+ // This pattern is produced by the JSCompiler when it collapses the
183
+ // statement above into the conditional loop below. To prevent this from
184
+ // happening, use a for-loop and reserve the init logic as below.
185
+
186
+ // Parentheses added to eliminate strict JS warning in Firefox.
187
+ for (var part; parts.length && (part = parts.shift());) {
188
+ if (!parts.length && goog.isDef(opt_object)) {
189
+ // last part and we have an object; use it
190
+ cur[part] = opt_object;
191
+ } else if (cur[part]) {
192
+ cur = cur[part];
193
+ } else {
194
+ cur = cur[part] = {};
195
+ }
196
+ }
197
+ };
198
+
199
+
200
+ /**
201
+ * Returns an object based on its fully qualified external name. If you are
202
+ * using a compilation pass that renames property names beware that using this
203
+ * function will not find renamed properties.
204
+ *
205
+ * @param {string} name The fully qualified name.
206
+ * @param {Object=} opt_obj The object within which to look; default is
207
+ * |goog.global|.
208
+ * @return {?} The value (object or primitive) or, if not found, null.
209
+ */
210
+ goog.getObjectByName = function(name, opt_obj) {
211
+ var parts = name.split('.');
212
+ var cur = opt_obj || goog.global;
213
+ for (var part; part = parts.shift(); ) {
214
+ if (goog.isDefAndNotNull(cur[part])) {
215
+ cur = cur[part];
216
+ } else {
217
+ return null;
218
+ }
219
+ }
220
+ return cur;
221
+ };
222
+
223
+
224
+ /**
225
+ * Globalizes a whole namespace, such as goog or goog.lang.
226
+ *
227
+ * @param {Object} obj The namespace to globalize.
228
+ * @param {Object=} opt_global The object to add the properties to.
229
+ * @deprecated Properties may be explicitly exported to the global scope, but
230
+ * this should no longer be done in bulk.
231
+ */
232
+ goog.globalize = function(obj, opt_global) {
233
+ var global = opt_global || goog.global;
234
+ for (var x in obj) {
235
+ global[x] = obj[x];
236
+ }
237
+ };
238
+
239
+
240
+ /**
241
+ * Adds a dependency from a file to the files it requires.
242
+ * @param {string} relPath The path to the js file.
243
+ * @param {Array} provides An array of strings with the names of the objects
244
+ * this file provides.
245
+ * @param {Array} requires An array of strings with the names of the objects
246
+ * this file requires.
247
+ */
248
+ goog.addDependency = function(relPath, provides, requires) {
249
+ if (!COMPILED) {
250
+ var provide, require;
251
+ var path = relPath.replace(/\\/g, '/');
252
+ var deps = goog.dependencies_;
253
+ for (var i = 0; provide = provides[i]; i++) {
254
+ deps.nameToPath[provide] = path;
255
+ if (!(path in deps.pathToNames)) {
256
+ deps.pathToNames[path] = {};
257
+ }
258
+ deps.pathToNames[path][provide] = true;
259
+ }
260
+ for (var j = 0; require = requires[j]; j++) {
261
+ if (!(path in deps.requires)) {
262
+ deps.requires[path] = {};
263
+ }
264
+ deps.requires[path][require] = true;
265
+ }
266
+ }
267
+ };
268
+
269
+
270
+
271
+
272
+ // NOTE(user): The debug DOM loader was included in base.js as an orignal
273
+ // way to do "debug-mode" development. The dependency system can sometimes
274
+ // be confusing, as can the debug DOM loader's asyncronous nature.
275
+ //
276
+ // With the DOM loader, a call to goog.require() is not blocking -- the
277
+ // script will not load until some point after the current script. If a
278
+ // namespace is needed at runtime, it needs to be defined in a previous
279
+ // script, or loaded via require() with its registered dependencies.
280
+ // User-defined namespaces may need their own deps file. See http://go/js_deps,
281
+ // http://go/genjsdeps, or, externally, DepsWriter.
282
+ // http://code.google.com/closure/library/docs/depswriter.html
283
+ //
284
+ // Because of legacy clients, the DOM loader can't be easily removed from
285
+ // base.js. Work is being done to make it disableable or replaceable for
286
+ // different environments (DOM-less JavaScript interpreters like Rhino or V8,
287
+ // for example). See bootstrap/ for more information.
288
+
289
+
290
+ /**
291
+ * @define {boolean} Whether to enable the debug loader.
292
+ *
293
+ * If enabled, a call to goog.require() will attempt to load the namespace by
294
+ * appending a script tag to the DOM (if the namespace has been registered).
295
+ *
296
+ * If disabled, goog.require() will simply assert that the namespace has been
297
+ * provided (and depend on the fact that some outside tool correctly ordered
298
+ * the script).
299
+ */
300
+ goog.ENABLE_DEBUG_LOADER = true;
301
+
302
+
303
+ /**
304
+ * Implements a system for the dynamic resolution of dependencies
305
+ * that works in parallel with the BUILD system. Note that all calls
306
+ * to goog.require will be stripped by the JSCompiler when the
307
+ * --closure_pass option is used.
308
+ * @see goog.provide
309
+ * @param {string} name Namespace to include (as was given in goog.provide())
310
+ * in the form "goog.package.part".
311
+ */
312
+ goog.require = function(name) {
313
+
314
+ // if the object already exists we do not need do do anything
315
+ // TODO(arv): If we start to support require based on file name this has
316
+ // to change
317
+ // TODO(arv): If we allow goog.foo.* this has to change
318
+ // TODO(arv): If we implement dynamic load after page load we should probably
319
+ // not remove this code for the compiled output
320
+ if (!COMPILED) {
321
+ if (goog.isProvided_(name)) {
322
+ return;
323
+ }
324
+
325
+ if (goog.ENABLE_DEBUG_LOADER) {
326
+ var path = goog.getPathFromDeps_(name);
327
+ if (path) {
328
+ goog.included_[path] = true;
329
+ goog.writeScripts_();
330
+ return;
331
+ }
332
+ }
333
+
334
+ var errorMessage = 'goog.require could not find: ' + name;
335
+ if (goog.global.console) {
336
+ goog.global.console['error'](errorMessage);
337
+ }
338
+
339
+
340
+ throw Error(errorMessage);
341
+
342
+ }
343
+ };
344
+
345
+
346
+ /**
347
+ * Path for included scripts
348
+ * @type {string}
349
+ */
350
+ goog.basePath = '';
351
+
352
+
353
+ /**
354
+ * A hook for overriding the base path.
355
+ * @type {string|undefined}
356
+ */
357
+ goog.global.CLOSURE_BASE_PATH;
358
+
359
+
360
+ /**
361
+ * Whether to write out Closure's deps file. By default,
362
+ * the deps are written.
363
+ * @type {boolean|undefined}
364
+ */
365
+ goog.global.CLOSURE_NO_DEPS;
366
+
367
+
368
+ /**
369
+ * A function to import a single script. This is meant to be overridden when
370
+ * Closure is being run in non-HTML contexts, such as web workers. It's defined
371
+ * in the global scope so that it can be set before base.js is loaded, which
372
+ * allows deps.js to be imported properly.
373
+ *
374
+ * The function is passed the script source, which is a relative URI. It should
375
+ * return true if the script was imported, false otherwise.
376
+ */
377
+ goog.global.CLOSURE_IMPORT_SCRIPT;
378
+
379
+
380
+ /**
381
+ * Null function used for default values of callbacks, etc.
382
+ * @return {void} Nothing.
383
+ */
384
+ goog.nullFunction = function() {};
385
+
386
+
387
+ /**
388
+ * The identity function. Returns its first argument.
389
+ *
390
+ * @param {...*} var_args The arguments of the function.
391
+ * @return {*} The first argument.
392
+ * @deprecated Use goog.functions.identity instead.
393
+ */
394
+ goog.identityFunction = function(var_args) {
395
+ return arguments[0];
396
+ };
397
+
398
+
399
+ /**
400
+ * When defining a class Foo with an abstract method bar(), you can do:
401
+ *
402
+ * Foo.prototype.bar = goog.abstractMethod
403
+ *
404
+ * Now if a subclass of Foo fails to override bar(), an error
405
+ * will be thrown when bar() is invoked.
406
+ *
407
+ * Note: This does not take the name of the function to override as
408
+ * an argument because that would make it more difficult to obfuscate
409
+ * our JavaScript code.
410
+ *
411
+ * @type {!Function}
412
+ * @throws {Error} when invoked to indicate the method should be
413
+ * overridden.
414
+ */
415
+ goog.abstractMethod = function() {
416
+ throw Error('unimplemented abstract method');
417
+ };
418
+
419
+
420
+ /**
421
+ * Adds a {@code getInstance} static method that always return the same instance
422
+ * object.
423
+ * @param {!Function} ctor The constructor for the class to add the static
424
+ * method to.
425
+ */
426
+ goog.addSingletonGetter = function(ctor) {
427
+ ctor.getInstance = function() {
428
+ return ctor.instance_ || (ctor.instance_ = new ctor());
429
+ };
430
+ };
431
+
432
+
433
+ if (!COMPILED && goog.ENABLE_DEBUG_LOADER) {
434
+ /**
435
+ * Object used to keep track of urls that have already been added. This
436
+ * record allows the prevention of circular dependencies.
437
+ * @type {Object}
438
+ * @private
439
+ */
440
+ goog.included_ = {};
441
+
442
+
443
+ /**
444
+ * This object is used to keep track of dependencies and other data that is
445
+ * used for loading scripts
446
+ * @private
447
+ * @type {Object}
448
+ */
449
+ goog.dependencies_ = {
450
+ pathToNames: {}, // 1 to many
451
+ nameToPath: {}, // 1 to 1
452
+ requires: {}, // 1 to many
453
+ // used when resolving dependencies to prevent us from
454
+ // visiting the file twice
455
+ visited: {},
456
+ written: {} // used to keep track of script files we have written
457
+ };
458
+
459
+
460
+ /**
461
+ * Tries to detect whether is in the context of an HTML document.
462
+ * @return {boolean} True if it looks like HTML document.
463
+ * @private
464
+ */
465
+ goog.inHtmlDocument_ = function() {
466
+ var doc = goog.global.document;
467
+ return typeof doc != 'undefined' &&
468
+ 'write' in doc; // XULDocument misses write.
469
+ };
470
+
471
+
472
+ /**
473
+ * Tries to detect the base path of the base.js script that bootstraps Closure
474
+ * @private
475
+ */
476
+ goog.findBasePath_ = function() {
477
+ if (goog.global.CLOSURE_BASE_PATH) {
478
+ goog.basePath = goog.global.CLOSURE_BASE_PATH;
479
+ return;
480
+ } else if (!goog.inHtmlDocument_()) {
481
+ return;
482
+ }
483
+ var doc = goog.global.document;
484
+ var scripts = doc.getElementsByTagName('script');
485
+ // Search backwards since the current script is in almost all cases the one
486
+ // that has base.js.
487
+ for (var i = scripts.length - 1; i >= 0; --i) {
488
+ var src = scripts[i].src;
489
+ var qmark = src.lastIndexOf('?');
490
+ var l = qmark == -1 ? src.length : qmark;
491
+ if (src.substr(l - 7, 7) == 'base.js') {
492
+ goog.basePath = src.substr(0, l - 7);
493
+ return;
494
+ }
495
+ }
496
+ };
497
+
498
+
499
+ /**
500
+ * Imports a script if, and only if, that script hasn't already been imported.
501
+ * (Must be called at execution time)
502
+ * @param {string} src Script source.
503
+ * @private
504
+ */
505
+ goog.importScript_ = function(src) {
506
+ var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||
507
+ goog.writeScriptTag_;
508
+ if (!goog.dependencies_.written[src] && importScript(src)) {
509
+ goog.dependencies_.written[src] = true;
510
+ }
511
+ };
512
+
513
+
514
+ /**
515
+ * The default implementation of the import function. Writes a script tag to
516
+ * import the script.
517
+ *
518
+ * @param {string} src The script source.
519
+ * @return {boolean} True if the script was imported, false otherwise.
520
+ * @private
521
+ */
522
+ goog.writeScriptTag_ = function(src) {
523
+ if (goog.inHtmlDocument_()) {
524
+ var doc = goog.global.document;
525
+ doc.write(
526
+ '<script type="text/javascript" src="' + src + '"></' + 'script>');
527
+ return true;
528
+ } else {
529
+ return false;
530
+ }
531
+ };
532
+
533
+
534
+ /**
535
+ * Resolves dependencies based on the dependencies added using addDependency
536
+ * and calls importScript_ in the correct order.
537
+ * @private
538
+ */
539
+ goog.writeScripts_ = function() {
540
+ // the scripts we need to write this time
541
+ var scripts = [];
542
+ var seenScript = {};
543
+ var deps = goog.dependencies_;
544
+
545
+ function visitNode(path) {
546
+ if (path in deps.written) {
547
+ return;
548
+ }
549
+
550
+ // we have already visited this one. We can get here if we have cyclic
551
+ // dependencies
552
+ if (path in deps.visited) {
553
+ if (!(path in seenScript)) {
554
+ seenScript[path] = true;
555
+ scripts.push(path);
556
+ }
557
+ return;
558
+ }
559
+
560
+ deps.visited[path] = true;
561
+
562
+ if (path in deps.requires) {
563
+ for (var requireName in deps.requires[path]) {
564
+ // If the required name is defined, we assume that it was already
565
+ // bootstrapped by other means.
566
+ if (!goog.isProvided_(requireName)) {
567
+ if (requireName in deps.nameToPath) {
568
+ visitNode(deps.nameToPath[requireName]);
569
+ } else {
570
+ throw Error('Undefined nameToPath for ' + requireName);
571
+ }
572
+ }
573
+ }
574
+ }
575
+
576
+ if (!(path in seenScript)) {
577
+ seenScript[path] = true;
578
+ scripts.push(path);
579
+ }
580
+ }
581
+
582
+ for (var path in goog.included_) {
583
+ if (!deps.written[path]) {
584
+ visitNode(path);
585
+ }
586
+ }
587
+
588
+ for (var i = 0; i < scripts.length; i++) {
589
+ if (scripts[i]) {
590
+ goog.importScript_(goog.basePath + scripts[i]);
591
+ } else {
592
+ throw Error('Undefined script input');
593
+ }
594
+ }
595
+ };
596
+
597
+
598
+ /**
599
+ * Looks at the dependency rules and tries to determine the script file that
600
+ * fulfills a particular rule.
601
+ * @param {string} rule In the form goog.namespace.Class or project.script.
602
+ * @return {?string} Url corresponding to the rule, or null.
603
+ * @private
604
+ */
605
+ goog.getPathFromDeps_ = function(rule) {
606
+ if (rule in goog.dependencies_.nameToPath) {
607
+ return goog.dependencies_.nameToPath[rule];
608
+ } else {
609
+ return null;
610
+ }
611
+ };
612
+
613
+ goog.findBasePath_();
614
+
615
+ // Allow projects to manage the deps files themselves.
616
+ if (!goog.global.CLOSURE_NO_DEPS) {
617
+ goog.importScript_(goog.basePath + 'deps.js');
618
+ }
619
+ }
620
+
621
+
622
+
623
+ //==============================================================================
624
+ // Language Enhancements
625
+ //==============================================================================
626
+
627
+
628
+ /**
629
+ * This is a "fixed" version of the typeof operator. It differs from the typeof
630
+ * operator in such a way that null returns 'null' and arrays return 'array'.
631
+ * @param {*} value The value to get the type of.
632
+ * @return {string} The name of the type.
633
+ */
634
+ goog.typeOf = function(value) {
635
+ var s = typeof value;
636
+ if (s == 'object') {
637
+ if (value) {
638
+ // Check these first, so we can avoid calling Object.prototype.toString if
639
+ // possible.
640
+ //
641
+ // IE improperly marshals tyepof across execution contexts, but a
642
+ // cross-context object will still return false for "instanceof Object".
643
+ if (value instanceof Array) {
644
+ return 'array';
645
+ } else if (value instanceof Object) {
646
+ return s;
647
+ }
648
+
649
+ // HACK: In order to use an Object prototype method on the arbitrary
650
+ // value, the compiler requires the value be cast to type Object,
651
+ // even though the ECMA spec explicitly allows it.
652
+ var className = Object.prototype.toString.call(
653
+ /** @type {Object} */ (value));
654
+ // In Firefox 3.6, attempting to access iframe window objects' length
655
+ // property throws an NS_ERROR_FAILURE, so we need to special-case it
656
+ // here.
657
+ if (className == '[object Window]') {
658
+ return 'object';
659
+ }
660
+
661
+ // We cannot always use constructor == Array or instanceof Array because
662
+ // different frames have different Array objects. In IE6, if the iframe
663
+ // where the array was created is destroyed, the array loses its
664
+ // prototype. Then dereferencing val.splice here throws an exception, so
665
+ // we can't use goog.isFunction. Calling typeof directly returns 'unknown'
666
+ // so that will work. In this case, this function will return false and
667
+ // most array functions will still work because the array is still
668
+ // array-like (supports length and []) even though it has lost its
669
+ // prototype.
670
+ // Mark Miller noticed that Object.prototype.toString
671
+ // allows access to the unforgeable [[Class]] property.
672
+ // 15.2.4.2 Object.prototype.toString ( )
673
+ // When the toString method is called, the following steps are taken:
674
+ // 1. Get the [[Class]] property of this object.
675
+ // 2. Compute a string value by concatenating the three strings
676
+ // "[object ", Result(1), and "]".
677
+ // 3. Return Result(2).
678
+ // and this behavior survives the destruction of the execution context.
679
+ if ((className == '[object Array]' ||
680
+ // In IE all non value types are wrapped as objects across window
681
+ // boundaries (not iframe though) so we have to do object detection
682
+ // for this edge case
683
+ typeof value.length == 'number' &&
684
+ typeof value.splice != 'undefined' &&
685
+ typeof value.propertyIsEnumerable != 'undefined' &&
686
+ !value.propertyIsEnumerable('splice')
687
+
688
+ )) {
689
+ return 'array';
690
+ }
691
+ // HACK: There is still an array case that fails.
692
+ // function ArrayImpostor() {}
693
+ // ArrayImpostor.prototype = [];
694
+ // var impostor = new ArrayImpostor;
695
+ // this can be fixed by getting rid of the fast path
696
+ // (value instanceof Array) and solely relying on
697
+ // (value && Object.prototype.toString.vall(value) === '[object Array]')
698
+ // but that would require many more function calls and is not warranted
699
+ // unless closure code is receiving objects from untrusted sources.
700
+
701
+ // IE in cross-window calls does not correctly marshal the function type
702
+ // (it appears just as an object) so we cannot use just typeof val ==
703
+ // 'function'. However, if the object has a call property, it is a
704
+ // function.
705
+ if ((className == '[object Function]' ||
706
+ typeof value.call != 'undefined' &&
707
+ typeof value.propertyIsEnumerable != 'undefined' &&
708
+ !value.propertyIsEnumerable('call'))) {
709
+ return 'function';
710
+ }
711
+
712
+
713
+ } else {
714
+ return 'null';
715
+ }
716
+
717
+ } else if (s == 'function' && typeof value.call == 'undefined') {
718
+ // In Safari typeof nodeList returns 'function', and on Firefox
719
+ // typeof behaves similarly for HTML{Applet,Embed,Object}Elements
720
+ // and RegExps. We would like to return object for those and we can
721
+ // detect an invalid function by making sure that the function
722
+ // object has a call method.
723
+ return 'object';
724
+ }
725
+ return s;
726
+ };
727
+
728
+
729
+ /**
730
+ * Safe way to test whether a property is enumarable. It allows testing
731
+ * for enumerable on objects where 'propertyIsEnumerable' is overridden or
732
+ * does not exist (like DOM nodes in IE). Does not use browser native
733
+ * Object.propertyIsEnumerable.
734
+ * @param {Object} object The object to test if the property is enumerable.
735
+ * @param {string} propName The property name to check for.
736
+ * @return {boolean} True if the property is enumarable.
737
+ * @private
738
+ */
739
+ goog.propertyIsEnumerableCustom_ = function(object, propName) {
740
+ // KJS in Safari 2 is not ECMAScript compatible and lacks crucial methods
741
+ // such as propertyIsEnumerable. We therefore use a workaround.
742
+ // Does anyone know a more efficient work around?
743
+ if (propName in object) {
744
+ for (var key in object) {
745
+ if (key == propName &&
746
+ Object.prototype.hasOwnProperty.call(object, propName)) {
747
+ return true;
748
+ }
749
+ }
750
+ }
751
+ return false;
752
+ };
753
+
754
+
755
+ /**
756
+ * Safe way to test whether a property is enumarable. It allows testing
757
+ * for enumerable on objects where 'propertyIsEnumerable' is overridden or
758
+ * does not exist (like DOM nodes in IE).
759
+ * @param {Object} object The object to test if the property is enumerable.
760
+ * @param {string} propName The property name to check for.
761
+ * @return {boolean} True if the property is enumarable.
762
+ * @private
763
+ */
764
+ goog.propertyIsEnumerable_ = function(object, propName) {
765
+ // In IE if object is from another window, cannot use propertyIsEnumerable
766
+ // from this window's Object. Will raise a 'JScript object expected' error.
767
+ if (object instanceof Object) {
768
+ return Object.prototype.propertyIsEnumerable.call(object, propName);
769
+ } else {
770
+ return goog.propertyIsEnumerableCustom_(object, propName);
771
+ }
772
+ };
773
+
774
+
775
+ /**
776
+ * Returns true if the specified value is not |undefined|.
777
+ * WARNING: Do not use this to test if an object has a property. Use the in
778
+ * operator instead. Additionally, this function assumes that the global
779
+ * undefined variable has not been redefined.
780
+ * @param {*} val Variable to test.
781
+ * @return {boolean} Whether variable is defined.
782
+ */
783
+ goog.isDef = function(val) {
784
+ return val !== undefined;
785
+ };
786
+
787
+
788
+ /**
789
+ * Returns true if the specified value is |null|
790
+ * @param {*} val Variable to test.
791
+ * @return {boolean} Whether variable is null.
792
+ */
793
+ goog.isNull = function(val) {
794
+ return val === null;
795
+ };
796
+
797
+
798
+ /**
799
+ * Returns true if the specified value is defined and not null
800
+ * @param {*} val Variable to test.
801
+ * @return {boolean} Whether variable is defined and not null.
802
+ */
803
+ goog.isDefAndNotNull = function(val) {
804
+ // Note that undefined == null.
805
+ return val != null;
806
+ };
807
+
808
+
809
+ /**
810
+ * Returns true if the specified value is an array
811
+ * @param {*} val Variable to test.
812
+ * @return {boolean} Whether variable is an array.
813
+ */
814
+ goog.isArray = function(val) {
815
+ return goog.typeOf(val) == 'array';
816
+ };
817
+
818
+
819
+ /**
820
+ * Returns true if the object looks like an array. To qualify as array like
821
+ * the value needs to be either a NodeList or an object with a Number length
822
+ * property.
823
+ * @param {*} val Variable to test.
824
+ * @return {boolean} Whether variable is an array.
825
+ */
826
+ goog.isArrayLike = function(val) {
827
+ var type = goog.typeOf(val);
828
+ return type == 'array' || type == 'object' && typeof val.length == 'number';
829
+ };
830
+
831
+
832
+ /**
833
+ * Returns true if the object looks like a Date. To qualify as Date-like
834
+ * the value needs to be an object and have a getFullYear() function.
835
+ * @param {*} val Variable to test.
836
+ * @return {boolean} Whether variable is a like a Date.
837
+ */
838
+ goog.isDateLike = function(val) {
839
+ return goog.isObject(val) && typeof val.getFullYear == 'function';
840
+ };
841
+
842
+
843
+ /**
844
+ * Returns true if the specified value is a string
845
+ * @param {*} val Variable to test.
846
+ * @return {boolean} Whether variable is a string.
847
+ */
848
+ goog.isString = function(val) {
849
+ return typeof val == 'string';
850
+ };
851
+
852
+
853
+ /**
854
+ * Returns true if the specified value is a boolean
855
+ * @param {*} val Variable to test.
856
+ * @return {boolean} Whether variable is boolean.
857
+ */
858
+ goog.isBoolean = function(val) {
859
+ return typeof val == 'boolean';
860
+ };
861
+
862
+
863
+ /**
864
+ * Returns true if the specified value is a number
865
+ * @param {*} val Variable to test.
866
+ * @return {boolean} Whether variable is a number.
867
+ */
868
+ goog.isNumber = function(val) {
869
+ return typeof val == 'number';
870
+ };
871
+
872
+
873
+ /**
874
+ * Returns true if the specified value is a function
875
+ * @param {*} val Variable to test.
876
+ * @return {boolean} Whether variable is a function.
877
+ */
878
+ goog.isFunction = function(val) {
879
+ return goog.typeOf(val) == 'function';
880
+ };
881
+
882
+
883
+ /**
884
+ * Returns true if the specified value is an object. This includes arrays
885
+ * and functions.
886
+ * @param {*} val Variable to test.
887
+ * @return {boolean} Whether variable is an object.
888
+ */
889
+ goog.isObject = function(val) {
890
+ var type = goog.typeOf(val);
891
+ return type == 'object' || type == 'array' || type == 'function';
892
+ };
893
+
894
+
895
+ /**
896
+ * Gets a unique ID for an object. This mutates the object so that further
897
+ * calls with the same object as a parameter returns the same value. The unique
898
+ * ID is guaranteed to be unique across the current session amongst objects that
899
+ * are passed into {@code getUid}. There is no guarantee that the ID is unique
900
+ * or consistent across sessions. It is unsafe to generate unique ID for
901
+ * function prototypes.
902
+ *
903
+ * @param {Object} obj The object to get the unique ID for.
904
+ * @return {number} The unique ID for the object.
905
+ */
906
+ goog.getUid = function(obj) {
907
+ // TODO(arv): Make the type stricter, do not accept null.
908
+
909
+ // In Opera window.hasOwnProperty exists but always returns false so we avoid
910
+ // using it. As a consequence the unique ID generated for BaseClass.prototype
911
+ // and SubClass.prototype will be the same.
912
+ return obj[goog.UID_PROPERTY_] ||
913
+ (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);
914
+ };
915
+
916
+
917
+ /**
918
+ * Removes the unique ID from an object. This is useful if the object was
919
+ * previously mutated using {@code goog.getUid} in which case the mutation is
920
+ * undone.
921
+ * @param {Object} obj The object to remove the unique ID field from.
922
+ */
923
+ goog.removeUid = function(obj) {
924
+ // TODO(arv): Make the type stricter, do not accept null.
925
+
926
+ // DOM nodes in IE are not instance of Object and throws exception
927
+ // for delete. Instead we try to use removeAttribute
928
+ if ('removeAttribute' in obj) {
929
+ obj.removeAttribute(goog.UID_PROPERTY_);
930
+ }
931
+ /** @preserveTry */
932
+ try {
933
+ delete obj[goog.UID_PROPERTY_];
934
+ } catch (ex) {
935
+ }
936
+ };
937
+
938
+
939
+ /**
940
+ * Name for unique ID property. Initialized in a way to help avoid collisions
941
+ * with other closure javascript on the same page.
942
+ * @type {string}
943
+ * @private
944
+ */
945
+ goog.UID_PROPERTY_ = 'closure_uid_' +
946
+ Math.floor(Math.random() * 2147483648).toString(36);
947
+
948
+
949
+ /**
950
+ * Counter for UID.
951
+ * @type {number}
952
+ * @private
953
+ */
954
+ goog.uidCounter_ = 0;
955
+
956
+
957
+ /**
958
+ * Adds a hash code field to an object. The hash code is unique for the
959
+ * given object.
960
+ * @param {Object} obj The object to get the hash code for.
961
+ * @return {number} The hash code for the object.
962
+ * @deprecated Use goog.getUid instead.
963
+ */
964
+ goog.getHashCode = goog.getUid;
965
+
966
+
967
+ /**
968
+ * Removes the hash code field from an object.
969
+ * @param {Object} obj The object to remove the field from.
970
+ * @deprecated Use goog.removeUid instead.
971
+ */
972
+ goog.removeHashCode = goog.removeUid;
973
+
974
+
975
+ /**
976
+ * Clones a value. The input may be an Object, Array, or basic type. Objects and
977
+ * arrays will be cloned recursively.
978
+ *
979
+ * WARNINGS:
980
+ * <code>goog.cloneObject</code> does not detect reference loops. Objects that
981
+ * refer to themselves will cause infinite recursion.
982
+ *
983
+ * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies
984
+ * UIDs created by <code>getUid</code> into cloned results.
985
+ *
986
+ * @param {*} obj The value to clone.
987
+ * @return {*} A clone of the input value.
988
+ * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.
989
+ */
990
+ goog.cloneObject = function(obj) {
991
+ var type = goog.typeOf(obj);
992
+ if (type == 'object' || type == 'array') {
993
+ if (obj.clone) {
994
+ return obj.clone();
995
+ }
996
+ var clone = type == 'array' ? [] : {};
997
+ for (var key in obj) {
998
+ clone[key] = goog.cloneObject(obj[key]);
999
+ }
1000
+ return clone;
1001
+ }
1002
+
1003
+ return obj;
1004
+ };
1005
+
1006
+
1007
+ /**
1008
+ * Forward declaration for the clone method. This is necessary until the
1009
+ * compiler can better support duck-typing constructs as used in
1010
+ * goog.cloneObject.
1011
+ *
1012
+ * TODO(user): Remove once the JSCompiler can infer that the check for
1013
+ * proto.clone is safe in goog.cloneObject.
1014
+ *
1015
+ * @type {Function}
1016
+ */
1017
+ Object.prototype.clone;
1018
+
1019
+
1020
+ /**
1021
+ * A native implementation of goog.bind.
1022
+ * @param {Function} fn A function to partially apply.
1023
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1024
+ * point to when the function is run.
1025
+ * @param {...*} var_args Additional arguments that are partially
1026
+ * applied to the function.
1027
+ * @return {!Function} A partially-applied form of the function bind() was
1028
+ * invoked as a method of.
1029
+ * @private
1030
+ * @suppress {deprecated} The compiler thinks that Function.prototype.bind
1031
+ * is deprecated because some people have declared a pure-JS version.
1032
+ * Only the pure-JS version is truly deprecated.
1033
+ */
1034
+ goog.bindNative_ = function(fn, selfObj, var_args) {
1035
+ return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
1036
+ };
1037
+
1038
+
1039
+ /**
1040
+ * A pure-JS implementation of goog.bind.
1041
+ * @param {Function} fn A function to partially apply.
1042
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1043
+ * point to when the function is run.
1044
+ * @param {...*} var_args Additional arguments that are partially
1045
+ * applied to the function.
1046
+ * @return {!Function} A partially-applied form of the function bind() was
1047
+ * invoked as a method of.
1048
+ * @private
1049
+ */
1050
+ goog.bindJs_ = function(fn, selfObj, var_args) {
1051
+ if (!fn) {
1052
+ throw new Error();
1053
+ }
1054
+
1055
+ if (arguments.length > 2) {
1056
+ var boundArgs = Array.prototype.slice.call(arguments, 2);
1057
+ return function() {
1058
+ // Prepend the bound arguments to the current arguments.
1059
+ var newArgs = Array.prototype.slice.call(arguments);
1060
+ Array.prototype.unshift.apply(newArgs, boundArgs);
1061
+ return fn.apply(selfObj, newArgs);
1062
+ };
1063
+
1064
+ } else {
1065
+ return function() {
1066
+ return fn.apply(selfObj, arguments);
1067
+ };
1068
+ }
1069
+ };
1070
+
1071
+
1072
+ /**
1073
+ * Partially applies this function to a particular 'this object' and zero or
1074
+ * more arguments. The result is a new function with some arguments of the first
1075
+ * function pre-filled and the value of |this| 'pre-specified'.<br><br>
1076
+ *
1077
+ * Remaining arguments specified at call-time are appended to the pre-
1078
+ * specified ones.<br><br>
1079
+ *
1080
+ * Also see: {@link #partial}.<br><br>
1081
+ *
1082
+ * Usage:
1083
+ * <pre>var barMethBound = bind(myFunction, myObj, 'arg1', 'arg2');
1084
+ * barMethBound('arg3', 'arg4');</pre>
1085
+ *
1086
+ * @param {Function} fn A function to partially apply.
1087
+ * @param {Object|undefined} selfObj Specifies the object which |this| should
1088
+ * point to when the function is run.
1089
+ * @param {...*} var_args Additional arguments that are partially
1090
+ * applied to the function.
1091
+ * @return {!Function} A partially-applied form of the function bind() was
1092
+ * invoked as a method of.
1093
+ * @suppress {deprecated} See above.
1094
+ */
1095
+ goog.bind = function(fn, selfObj, var_args) {
1096
+ // TODO(nicksantos): narrow the type signature.
1097
+ if (Function.prototype.bind &&
1098
+ // NOTE(nicksantos): Somebody pulled base.js into the default
1099
+ // Chrome extension environment. This means that for Chrome extensions,
1100
+ // they get the implementation of Function.prototype.bind that
1101
+ // calls goog.bind instead of the native one. Even worse, we don't want
1102
+ // to introduce a circular dependency between goog.bind and
1103
+ // Function.prototype.bind, so we have to hack this to make sure it
1104
+ // works correctly.
1105
+ Function.prototype.bind.toString().indexOf('native code') != -1) {
1106
+ goog.bind = goog.bindNative_;
1107
+ } else {
1108
+ goog.bind = goog.bindJs_;
1109
+ }
1110
+ return goog.bind.apply(null, arguments);
1111
+ };
1112
+
1113
+
1114
+ /**
1115
+ * Like bind(), except that a 'this object' is not required. Useful when the
1116
+ * target function is already bound.
1117
+ *
1118
+ * Usage:
1119
+ * var g = partial(f, arg1, arg2);
1120
+ * g(arg3, arg4);
1121
+ *
1122
+ * @param {Function} fn A function to partially apply.
1123
+ * @param {...*} var_args Additional arguments that are partially
1124
+ * applied to fn.
1125
+ * @return {!Function} A partially-applied form of the function bind() was
1126
+ * invoked as a method of.
1127
+ */
1128
+ goog.partial = function(fn, var_args) {
1129
+ var args = Array.prototype.slice.call(arguments, 1);
1130
+ return function() {
1131
+ // Prepend the bound arguments to the current arguments.
1132
+ var newArgs = Array.prototype.slice.call(arguments);
1133
+ newArgs.unshift.apply(newArgs, args);
1134
+ return fn.apply(this, newArgs);
1135
+ };
1136
+ };
1137
+
1138
+
1139
+ /**
1140
+ * Copies all the members of a source object to a target object. This method
1141
+ * does not work on all browsers for all objects that contain keys such as
1142
+ * toString or hasOwnProperty. Use goog.object.extend for this purpose.
1143
+ * @param {Object} target Target.
1144
+ * @param {Object} source Source.
1145
+ */
1146
+ goog.mixin = function(target, source) {
1147
+ for (var x in source) {
1148
+ target[x] = source[x];
1149
+ }
1150
+
1151
+ // For IE7 or lower, the for-in-loop does not contain any properties that are
1152
+ // not enumerable on the prototype object (for example, isPrototypeOf from
1153
+ // Object.prototype) but also it will not include 'replace' on objects that
1154
+ // extend String and change 'replace' (not that it is common for anyone to
1155
+ // extend anything except Object).
1156
+ };
1157
+
1158
+
1159
+ /**
1160
+ * @return {number} An integer value representing the number of milliseconds
1161
+ * between midnight, January 1, 1970 and the current time.
1162
+ */
1163
+ goog.now = Date.now || (function() {
1164
+ // Unary plus operator converts its operand to a number which in the case of
1165
+ // a date is done by calling getTime().
1166
+ return +new Date();
1167
+ });
1168
+
1169
+
1170
+ /**
1171
+ * Evals javascript in the global scope. In IE this uses execScript, other
1172
+ * browsers use goog.global.eval. If goog.global.eval does not evaluate in the
1173
+ * global scope (for example, in Safari), appends a script tag instead.
1174
+ * Throws an exception if neither execScript or eval is defined.
1175
+ * @param {string} script JavaScript string.
1176
+ */
1177
+ goog.globalEval = function(script) {
1178
+ if (goog.global.execScript) {
1179
+ goog.global.execScript(script, 'JavaScript');
1180
+ } else if (goog.global.eval) {
1181
+ // Test to see if eval works
1182
+ if (goog.evalWorksForGlobals_ == null) {
1183
+ goog.global.eval('var _et_ = 1;');
1184
+ if (typeof goog.global['_et_'] != 'undefined') {
1185
+ delete goog.global['_et_'];
1186
+ goog.evalWorksForGlobals_ = true;
1187
+ } else {
1188
+ goog.evalWorksForGlobals_ = false;
1189
+ }
1190
+ }
1191
+
1192
+ if (goog.evalWorksForGlobals_) {
1193
+ goog.global.eval(script);
1194
+ } else {
1195
+ var doc = goog.global.document;
1196
+ var scriptElt = doc.createElement('script');
1197
+ scriptElt.type = 'text/javascript';
1198
+ scriptElt.defer = false;
1199
+ // Note(user): can't use .innerHTML since "t('<test>')" will fail and
1200
+ // .text doesn't work in Safari 2. Therefore we append a text node.
1201
+ scriptElt.appendChild(doc.createTextNode(script));
1202
+ doc.body.appendChild(scriptElt);
1203
+ doc.body.removeChild(scriptElt);
1204
+ }
1205
+ } else {
1206
+ throw Error('goog.globalEval not available');
1207
+ }
1208
+ };
1209
+
1210
+
1211
+ /**
1212
+ * Indicates whether or not we can call 'eval' directly to eval code in the
1213
+ * global scope. Set to a Boolean by the first call to goog.globalEval (which
1214
+ * empirically tests whether eval works for globals). @see goog.globalEval
1215
+ * @type {?boolean}
1216
+ * @private
1217
+ */
1218
+ goog.evalWorksForGlobals_ = null;
1219
+
1220
+
1221
+ /**
1222
+ * Optional map of CSS class names to obfuscated names used with
1223
+ * goog.getCssName().
1224
+ * @type {Object|undefined}
1225
+ * @private
1226
+ * @see goog.setCssNameMapping
1227
+ */
1228
+ goog.cssNameMapping_;
1229
+
1230
+
1231
+ /**
1232
+ * Optional obfuscation style for CSS class names. Should be set to either
1233
+ * 'BY_WHOLE' or 'BY_PART' if defined.
1234
+ * @type {string|undefined}
1235
+ * @private
1236
+ * @see goog.setCssNameMapping
1237
+ */
1238
+ goog.cssNameMappingStyle_;
1239
+
1240
+
1241
+ /**
1242
+ * Handles strings that are intended to be used as CSS class names.
1243
+ *
1244
+ * This function works in tandem with @see goog.setCssNameMapping.
1245
+ *
1246
+ * Without any mapping set, the arguments are simple joined with a
1247
+ * hyphen and passed through unaltered.
1248
+ *
1249
+ * When there is a mapping, there are two possible styles in which
1250
+ * these mappings are used. In the BY_PART style, each part (i.e. in
1251
+ * between hyphens) of the passed in css name is rewritten according
1252
+ * to the map. In the BY_WHOLE style, the full css name is looked up in
1253
+ * the map directly. If a rewrite is not specified by the map, the
1254
+ * compiler will output a warning.
1255
+ *
1256
+ * When the mapping is passed to the compiler, it will replace calls
1257
+ * to goog.getCssName with the strings from the mapping, e.g.
1258
+ * var x = goog.getCssName('foo');
1259
+ * var y = goog.getCssName(this.baseClass, 'active');
1260
+ * becomes:
1261
+ * var x= 'foo';
1262
+ * var y = this.baseClass + '-active';
1263
+ *
1264
+ * If one argument is passed it will be processed, if two are passed
1265
+ * only the modifier will be processed, as it is assumed the first
1266
+ * argument was generated as a result of calling goog.getCssName.
1267
+ *
1268
+ * @param {string} className The class name.
1269
+ * @param {string=} opt_modifier A modifier to be appended to the class name.
1270
+ * @return {string} The class name or the concatenation of the class name and
1271
+ * the modifier.
1272
+ */
1273
+ goog.getCssName = function(className, opt_modifier) {
1274
+ var getMapping = function(cssName) {
1275
+ return goog.cssNameMapping_[cssName] || cssName;
1276
+ };
1277
+
1278
+ var renameByParts = function(cssName) {
1279
+ // Remap all the parts individually.
1280
+ var parts = cssName.split('-');
1281
+ var mapped = [];
1282
+ for (var i = 0; i < parts.length; i++) {
1283
+ mapped.push(getMapping(parts[i]));
1284
+ }
1285
+ return mapped.join('-');
1286
+ };
1287
+
1288
+ var rename;
1289
+ if (goog.cssNameMapping_) {
1290
+ rename = goog.cssNameMappingStyle_ == 'BY_WHOLE' ?
1291
+ getMapping : renameByParts;
1292
+ } else {
1293
+ rename = function(a) {
1294
+ return a;
1295
+ };
1296
+ }
1297
+
1298
+ if (opt_modifier) {
1299
+ return className + '-' + rename(opt_modifier);
1300
+ } else {
1301
+ return rename(className);
1302
+ }
1303
+ };
1304
+
1305
+
1306
+ /**
1307
+ * Sets the map to check when returning a value from goog.getCssName(). Example:
1308
+ * <pre>
1309
+ * goog.setCssNameMapping({
1310
+ * "goog": "a",
1311
+ * "disabled": "b",
1312
+ * });
1313
+ *
1314
+ * var x = goog.getCssName('goog');
1315
+ * // The following evaluates to: "a a-b".
1316
+ * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')
1317
+ * </pre>
1318
+ * When declared as a map of string literals to string literals, the JSCompiler
1319
+ * will replace all calls to goog.getCssName() using the supplied map if the
1320
+ * --closure_pass flag is set.
1321
+ *
1322
+ * @param {!Object} mapping A map of strings to strings where keys are possible
1323
+ * arguments to goog.getCssName() and values are the corresponding values
1324
+ * that should be returned.
1325
+ * @param {string=} opt_style The style of css name mapping. There are two valid
1326
+ * options: 'BY_PART', and 'BY_WHOLE'.
1327
+ * @see goog.getCssName for a description.
1328
+ */
1329
+ goog.setCssNameMapping = function(mapping, opt_style) {
1330
+ goog.cssNameMapping_ = mapping;
1331
+ goog.cssNameMappingStyle_ = opt_style;
1332
+ };
1333
+
1334
+
1335
+ /**
1336
+ * To use CSS renaming in compiled mode, one of the input files should have a
1337
+ * call to goog.setCssNameMapping() with an object literal that the JSCompiler
1338
+ * can extract and use to replace all calls to goog.getCssName(). In uncompiled
1339
+ * mode, JavaScript code should be loaded before this base.js file that declares
1340
+ * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is
1341
+ * to ensure that the mapping is loaded before any calls to goog.getCssName()
1342
+ * are made in uncompiled mode.
1343
+ *
1344
+ * A hook for overriding the CSS name mapping.
1345
+ * @type {Object|undefined}
1346
+ */
1347
+ goog.global.CLOSURE_CSS_NAME_MAPPING;
1348
+
1349
+
1350
+ if (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {
1351
+ // This does not call goog.setCssNameMapping() because the JSCompiler
1352
+ // requires that goog.setCssNameMapping() be called with an object literal.
1353
+ goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;
1354
+ }
1355
+
1356
+
1357
+ /**
1358
+ * Abstract implementation of goog.getMsg for use with localized messages.
1359
+ * @param {string} str Translatable string, places holders in the form {$foo}.
1360
+ * @param {Object=} opt_values Map of place holder name to value.
1361
+ * @return {string} message with placeholders filled.
1362
+ */
1363
+ goog.getMsg = function(str, opt_values) {
1364
+ var values = opt_values || {};
1365
+ for (var key in values) {
1366
+ var value = ('' + values[key]).replace(/\$/g, '$$$$');
1367
+ str = str.replace(new RegExp('\\{\\$' + key + '\\}', 'gi'), value);
1368
+ }
1369
+ return str;
1370
+ };
1371
+
1372
+
1373
+ /**
1374
+ * Exposes an unobfuscated global namespace path for the given object.
1375
+ * Note that fields of the exported object *will* be obfuscated,
1376
+ * unless they are exported in turn via this function or
1377
+ * goog.exportProperty
1378
+ *
1379
+ * <p>Also handy for making public items that are defined in anonymous
1380
+ * closures.
1381
+ *
1382
+ * ex. goog.exportSymbol('Foo', Foo);
1383
+ *
1384
+ * ex. goog.exportSymbol('public.path.Foo.staticFunction',
1385
+ * Foo.staticFunction);
1386
+ * public.path.Foo.staticFunction();
1387
+ *
1388
+ * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',
1389
+ * Foo.prototype.myMethod);
1390
+ * new public.path.Foo().myMethod();
1391
+ *
1392
+ * @param {string} publicPath Unobfuscated name to export.
1393
+ * @param {*} object Object the name should point to.
1394
+ * @param {Object=} opt_objectToExportTo The object to add the path to; default
1395
+ * is |goog.global|.
1396
+ */
1397
+ goog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {
1398
+ goog.exportPath_(publicPath, object, opt_objectToExportTo);
1399
+ };
1400
+
1401
+
1402
+ /**
1403
+ * Exports a property unobfuscated into the object's namespace.
1404
+ * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);
1405
+ * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);
1406
+ * @param {Object} object Object whose static property is being exported.
1407
+ * @param {string} publicName Unobfuscated name to export.
1408
+ * @param {*} symbol Object the name should point to.
1409
+ */
1410
+ goog.exportProperty = function(object, publicName, symbol) {
1411
+ object[publicName] = symbol;
1412
+ };
1413
+
1414
+
1415
+ /**
1416
+ * Inherit the prototype methods from one constructor into another.
1417
+ *
1418
+ * Usage:
1419
+ * <pre>
1420
+ * function ParentClass(a, b) { }
1421
+ * ParentClass.prototype.foo = function(a) { }
1422
+ *
1423
+ * function ChildClass(a, b, c) {
1424
+ * goog.base(this, a, b);
1425
+ * }
1426
+ * goog.inherits(ChildClass, ParentClass);
1427
+ *
1428
+ * var child = new ChildClass('a', 'b', 'see');
1429
+ * child.foo(); // works
1430
+ * </pre>
1431
+ *
1432
+ * In addition, a superclass' implementation of a method can be invoked
1433
+ * as follows:
1434
+ *
1435
+ * <pre>
1436
+ * ChildClass.prototype.foo = function(a) {
1437
+ * ChildClass.superClass_.foo.call(this, a);
1438
+ * // other code
1439
+ * };
1440
+ * </pre>
1441
+ *
1442
+ * @param {Function} childCtor Child class.
1443
+ * @param {Function} parentCtor Parent class.
1444
+ */
1445
+ goog.inherits = function(childCtor, parentCtor) {
1446
+ /** @constructor */
1447
+ function tempCtor() {};
1448
+ tempCtor.prototype = parentCtor.prototype;
1449
+ childCtor.superClass_ = parentCtor.prototype;
1450
+ childCtor.prototype = new tempCtor();
1451
+ childCtor.prototype.constructor = childCtor;
1452
+ };
1453
+
1454
+
1455
+ /**
1456
+ * Call up to the superclass.
1457
+ *
1458
+ * If this is called from a constructor, then this calls the superclass
1459
+ * contructor with arguments 1-N.
1460
+ *
1461
+ * If this is called from a prototype method, then you must pass
1462
+ * the name of the method as the second argument to this function. If
1463
+ * you do not, you will get a runtime error. This calls the superclass'
1464
+ * method with arguments 2-N.
1465
+ *
1466
+ * This function only works if you use goog.inherits to express
1467
+ * inheritance relationships between your classes.
1468
+ *
1469
+ * This function is a compiler primitive. At compile-time, the
1470
+ * compiler will do macro expansion to remove a lot of
1471
+ * the extra overhead that this function introduces. The compiler
1472
+ * will also enforce a lot of the assumptions that this function
1473
+ * makes, and treat it as a compiler error if you break them.
1474
+ *
1475
+ * @param {!Object} me Should always be "this".
1476
+ * @param {*=} opt_methodName The method name if calling a super method.
1477
+ * @param {...*} var_args The rest of the arguments.
1478
+ * @return {*} The return value of the superclass method.
1479
+ */
1480
+ goog.base = function(me, opt_methodName, var_args) {
1481
+ var caller = arguments.callee.caller;
1482
+ if (caller.superClass_) {
1483
+ // This is a constructor. Call the superclass constructor.
1484
+ return caller.superClass_.constructor.apply(
1485
+ me, Array.prototype.slice.call(arguments, 1));
1486
+ }
1487
+
1488
+ var args = Array.prototype.slice.call(arguments, 2);
1489
+ var foundCaller = false;
1490
+ for (var ctor = me.constructor;
1491
+ ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {
1492
+ if (ctor.prototype[opt_methodName] === caller) {
1493
+ foundCaller = true;
1494
+ } else if (foundCaller) {
1495
+ return ctor.prototype[opt_methodName].apply(me, args);
1496
+ }
1497
+ }
1498
+
1499
+ // If we did not find the caller in the prototype chain,
1500
+ // then one of two things happened:
1501
+ // 1) The caller is an instance method.
1502
+ // 2) This method was not called by the right caller.
1503
+ if (me[opt_methodName] === caller) {
1504
+ return me.constructor.prototype[opt_methodName].apply(me, args);
1505
+ } else {
1506
+ throw Error(
1507
+ 'goog.base called from a method of one name ' +
1508
+ 'to a method of a different name');
1509
+ }
1510
+ };
1511
+
1512
+
1513
+ /**
1514
+ * Allow for aliasing within scope functions. This function exists for
1515
+ * uncompiled code - in compiled code the calls will be inlined and the
1516
+ * aliases applied. In uncompiled code the function is simply run since the
1517
+ * aliases as written are valid JavaScript.
1518
+ * @param {function()} fn Function to call. This function can contain aliases
1519
+ * to namespaces (e.g. "var dom = goog.dom") or classes
1520
+ * (e.g. "var Timer = goog.Timer").
1521
+ */
1522
+ goog.scope = function(fn) {
1523
+ fn.call(goog.global);
1524
+ };
1525
+
1526
+
1527
+ ;
1528
+ FI"
1529
+ F"%860faa559eddc91938407118701c3e93