OLD | NEW |
1 // Copyright 2006 Google Inc. | 1 // Copyright 2006 Google Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above copyright | 10 // * Redistributions in binary form must reproduce the above copyright |
11 // notice, this list of conditions and the following disclaimer in | 11 // notice, this list of conditions and the following disclaimer in |
12 // the documentation and/or other materials provided with the | 12 // the documentation and/or other materials provided with the |
13 // distribution. | 13 // distribution. |
14 // | 14 // |
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
18 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 18 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
19 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 19 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 20 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
21 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 22 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
23 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 23 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
24 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 24 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
25 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 // POSSIBILITY OF SUCH DAMAGE. | 26 // POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 // NOTE: This file has been changed from the one on doctype. The following | 28 // NOTE: This file has been changed from the one on doctype. The following |
29 // changes were made: | 29 // changes were made: |
30 // - Removed goog.globalEval because it calls eval() which is not allowed from | 30 // - Removed goog.globalEval because it calls eval() which is not allowed from |
31 // inside v8 extensions. If we ever need to use globalEval, we will need to | 31 // inside v8 extensions. If we ever need to use globalEval, we will need to |
32 // find a way to work around this problem. | 32 // find a way to work around this problem. |
33 // - Remove Function.prototype.apply() emulation for the same reason. This one | 33 // - Remove Function.prototype.apply() emulation for the same reason. This one |
34 // is useless anyway because V8 supports apply() natively. | 34 // is useless anyway because V8 supports apply() natively. |
35 | 35 |
36 /** | 36 /** |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 * @param {Object} opt_object the object to expose at the end of the path. | 117 * @param {Object} opt_object the object to expose at the end of the path. |
118 * @private | 118 * @private |
119 */ | 119 */ |
120 goog.exportPath_ = function(name, opt_object) { | 120 goog.exportPath_ = function(name, opt_object) { |
121 var parts = name.split('.'); | 121 var parts = name.split('.'); |
122 var cur = goog.global; | 122 var cur = goog.global; |
123 var part; | 123 var part; |
124 | 124 |
125 // Internet Explorer exhibits strange behavior when throwing errors from | 125 // Internet Explorer exhibits strange behavior when throwing errors from |
126 // methods externed in this manner. See the testExportSymbolExceptions in | 126 // methods externed in this manner. See the testExportSymbolExceptions in |
127 // base_test.html for an example. | 127 // base_test.html for an example. |
128 if (!(parts[0] in cur) && cur.execScript) { | 128 if (!(parts[0] in cur) && cur.execScript) { |
129 cur.execScript('var ' + parts[0]); | 129 cur.execScript('var ' + parts[0]); |
130 } | 130 } |
131 | 131 |
132 // Parentheses added to eliminate strict JS warning in Firefox. | 132 // Parentheses added to eliminate strict JS warning in Firefox. |
133 while ((part = parts.shift())) { | 133 while ((part = parts.shift())) { |
134 if (!parts.length && goog.isDef(opt_object)) { | 134 if (!parts.length && goog.isDef(opt_object)) { |
135 // last part and we have an object; use it | 135 // last part and we have an object; use it |
136 cur[part] = opt_object; | 136 cur[part] = opt_object; |
137 } else if (cur[part]) { | 137 } else if (cur[part]) { |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 * }); | 1006 * }); |
1007 * </pre> | 1007 * </pre> |
1008 * | 1008 * |
1009 * @param {Object} source from which to copy properties. | 1009 * @param {Object} source from which to copy properties. |
1010 * @see goog.mixin | 1010 * @see goog.mixin |
1011 * @deprecated | 1011 * @deprecated |
1012 */ | 1012 */ |
1013 Function.prototype.mixin = function(source) { | 1013 Function.prototype.mixin = function(source) { |
1014 goog.mixin(this.prototype, source); | 1014 goog.mixin(this.prototype, source); |
1015 }; | 1015 }; |
OLD | NEW |