Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <include src="assert.js"> | 5 <include src="assert.js"> |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The global object. | 8 * The global object. |
| 9 * @type {!Object} | 9 * @type {!Object} |
| 10 * @const | 10 * @const |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 return function() {}; | 122 return function() {}; |
| 123 } | 123 } |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * Helper function for defineProperty that returns the setter of the right | 126 * Helper function for defineProperty that returns the setter of the right |
| 127 * kind. | 127 * kind. |
| 128 * @param {string} name The name of the property we are defining the setter | 128 * @param {string} name The name of the property we are defining the setter |
| 129 * for. | 129 * for. |
| 130 * @param {PropertyKind} kind The kind of property we are getting the | 130 * @param {PropertyKind} kind The kind of property we are getting the |
| 131 * setter for. | 131 * setter for. |
| 132 * @param {function():void=} opt_setHook A function to run after the property | 132 * @param {function(*, *):void=} opt_setHook A function to run after the |
|
Dan Beam
2014/08/06 16:06:59
this is fixed here: https://chromiumcodereview.app
Vitaly Pavlenko
2014/08/07 18:18:13
This file is removed in my Patch Set #6.
| |
| 133 * is set, but before the propertyChange event is fired. | 133 * property is set, but before the propertyChange event is fired. |
| 134 * @return {function(*):void} The function to use as a setter. | 134 * @return {function(*):void} The function to use as a setter. |
| 135 */ | 135 */ |
| 136 function getSetter(name, kind, opt_setHook) { | 136 function getSetter(name, kind, opt_setHook) { |
| 137 switch (kind) { | 137 switch (kind) { |
| 138 case PropertyKind.JS: | 138 case PropertyKind.JS: |
| 139 var privateName = name + '_'; | 139 var privateName = name + '_'; |
| 140 return function(value) { | 140 return function(value) { |
| 141 var oldValue = this[name]; | 141 var oldValue = this[name]; |
| 142 if (value !== oldValue) { | 142 if (value !== oldValue) { |
| 143 this[privateName] = value; | 143 this[privateName] = value; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 PropertyKind: PropertyKind | 353 PropertyKind: PropertyKind |
| 354 }; | 354 }; |
| 355 })(); | 355 })(); |
| 356 | 356 |
| 357 | 357 |
| 358 /** | 358 /** |
| 359 * TODO(kgr): Move this to another file which is to be loaded last. | 359 * TODO(kgr): Move this to another file which is to be loaded last. |
| 360 * This will be done as part of future work to make this code pre-compilable. | 360 * This will be done as part of future work to make this code pre-compilable. |
| 361 */ | 361 */ |
| 362 cr.initialize(); | 362 cr.initialize(); |
| OLD | NEW |