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 DOMPoint extends DOMPointReadOnly { |
| 11 constructor(x = 0, y = 0, z = 0, w = 1) { |
| 12 super(x, y, z, w); |
| 13 |
| 14 defineProperty(this, 'x', { |
| 15 value: x, |
| 16 configurable: true, |
| 17 enumerable: true, |
| 18 writable: true |
| 19 }); |
| 20 |
| 21 defineProperty(this, 'y', { |
| 22 value: y, |
| 23 configurable: true, |
| 24 enumerable: true, |
| 25 writable: true |
| 26 }); |
| 27 |
| 28 defineProperty(this, 'z', { |
| 29 value: z, |
| 30 configurable: true, |
| 31 enumerable: true, |
| 32 writable: true |
| 33 }); |
| 34 |
| 35 defineProperty(this, 'w', { |
| 36 value: w, |
| 37 configurable: true, |
| 38 enumerable: true, |
| 39 writable: true |
| 40 }); |
| 41 } |
| 42 |
| 43 static fromPoint(init) { |
| 44 return new DOMPoint(init.x, init.y, init.z, init.w); |
| 45 } |
| 46 } |
| 47 |
| 48 binding.createDOMPoint = DOMPoint.fromPoint; |
| 49 |
| 50 defineProperty(global, 'DOMPoint', { |
| 51 value: DOMPoint, |
| 52 configurable: true, |
| 53 enumerable: false, |
| 54 writable: true |
| 55 }); |
| 56 }); |
OLD | NEW |