| 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 /** | 5 /** |
| 6 * @fileoverview Provides a partial copy of goog.inherits, so inheritance works | 6 * @fileoverview Provides a partial copy of goog.inherits, so inheritance works |
| 7 * even in the absence of Closure. | 7 * even in the absence of Closure. |
| 8 */ | 8 */ |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| 11 // A partial copy of goog.inherits, so inheritance works even in the absence of | 11 // A partial copy of goog.inherits, so inheritance works even in the absence of |
| 12 // Closure. | 12 // Closure. |
| 13 function inherits(childCtor, parentCtor) { | 13 function inherits(childCtor, parentCtor) { |
| 14 /** @constructor */ | 14 /** @constructor */ |
| 15 function tempCtor() { | 15 function tempCtor() {} |
| 16 } | |
| 17 tempCtor.prototype = parentCtor.prototype; | 16 tempCtor.prototype = parentCtor.prototype; |
| 18 childCtor.prototype = new tempCtor; | 17 childCtor.prototype = new tempCtor; |
| 19 childCtor.prototype.constructor = childCtor; | 18 childCtor.prototype.constructor = childCtor; |
| 20 } | 19 } |
| OLD | NEW |