OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of html; | 5 part of html; |
6 | 6 |
7 class _AudioContextFactoryProvider { | |
8 | |
9 static AudioContext createAudioContext() { | |
10 return JS('AudioContext', | |
11 'new (window.AudioContext || window.webkitAudioContext)()'); | |
12 } | |
13 } | |
14 | |
15 class _PointFactoryProvider { | 7 class _PointFactoryProvider { |
16 static Point createPoint(num x, num y) => | 8 static Point createPoint(num x, num y) => |
17 JS('Point', 'new WebKitPoint(#, #)', x, y); | 9 JS('Point', 'new WebKitPoint(#, #)', x, y); |
18 } | 10 } |
19 | 11 |
20 class _WebSocketFactoryProvider { | 12 class _WebSocketFactoryProvider { |
21 static WebSocket createWebSocket(String url) => | 13 static WebSocket createWebSocket(String url) => |
22 JS('WebSocket', 'new WebSocket(#)', url); | 14 JS('WebSocket', 'new WebSocket(#)', url); |
23 } | 15 } |
24 | 16 |
25 class _TextFactoryProvider { | 17 class _TextFactoryProvider { |
26 static Text createText(String data) => | 18 static Text createText(String data) => |
27 JS('Text', 'document.createTextNode(#)', data); | 19 JS('Text', 'document.createTextNode(#)', data); |
28 } | 20 } |
OLD | NEW |