Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js

Issue 1701283002: Implement DOMPoint using v8 extras. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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', {
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;
47
48 defineProperty(global, 'DOMPointReadOnly', {
49 value: DOMPointReadOnly,
50 configurable: true,
51 enumerable: false,
52 writable: true
53 });
54 });
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/geometry/DOMPoint.js ('k') | third_party/WebKit/Source/modules/vr/VREyeParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698