Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 (function(global, binding, v8) { | |
| 6 'use strict'; | |
| 7 | |
| 8 const defineProperty = global.Object.defineProperty; | |
| 9 | |
| 10 class DOMPointReadOnly { | |
| 11 constructor(x = 0, y = 0, z = 0, w = 1) { | |
| 12 defineProperty(this, 'x', { | |
|
domenic
2016/02/18 19:04:41
While I personally prefer this design, the spec ma
zino
2016/02/22 09:51:01
Done.
| |
| 13 value: x, | |
| 14 configurable: true, | |
| 15 enumerable: true, | |
| 16 writable: false | |
| 17 }); | |
| 18 | |
| 19 defineProperty(this, 'y', { | |
| 20 value: y, | |
| 21 configurable: true, | |
| 22 enumerable: true, | |
| 23 writable: false | |
| 24 }); | |
| 25 | |
| 26 defineProperty(this, 'z', { | |
| 27 value: z, | |
| 28 configurable: true, | |
| 29 enumerable: true, | |
| 30 writable: false | |
| 31 }); | |
| 32 | |
| 33 defineProperty(this, 'w', { | |
| 34 value: w, | |
| 35 configurable: true, | |
| 36 enumerable: true, | |
| 37 writable: false | |
| 38 }); | |
| 39 } | |
| 40 | |
| 41 static fromPoint(init) { | |
| 42 return new DOMPointReadOnly(init.x, init.y, init.z, init.w); | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 binding.createDOMPointReadOnly = DOMPointReadOnly.fromPoint; | |
|
domenic
2016/02/18 19:04:41
An option here would be to instead do `binding.cre
zino
2016/02/22 09:51:01
Done.
| |
| 47 | |
| 48 defineProperty(global, 'DOMPointReadOnly', { | |
| 49 value: DOMPointReadOnly, | |
| 50 configurable: true, | |
| 51 enumerable: false, | |
| 52 writable: true | |
| 53 }); | |
| 54 }); | |
| OLD | NEW |