| OLD | NEW |
| 1 #library('dom'); | 1 #library('dom'); |
| 2 | 2 |
| 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 // DO NOT EDIT | 7 // DO NOT EDIT |
| 8 // Auto-generated Dart DOM library. | 8 // Auto-generated Dart DOM library. |
| 9 | 9 |
| 10 | 10 |
| (...skipping 24960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24971 void focus() => _window.focus(); | 24971 void focus() => _window.focus(); |
| 24972 | 24972 |
| 24973 void blur() => _window.blur(); | 24973 void blur() => _window.blur(); |
| 24974 | 24974 |
| 24975 void close() => _window.close(); | 24975 void close() => _window.close(); |
| 24976 | 24976 |
| 24977 void postMessage(Dynamic message, | 24977 void postMessage(Dynamic message, |
| 24978 String targetOrigin, | 24978 String targetOrigin, |
| 24979 [List messagePorts = null]) { | 24979 [List messagePorts = null]) { |
| 24980 if (messagePorts == null) { | 24980 if (messagePorts == null) { |
| 24981 _window.postMessage(message, targetOrigin); | 24981 _postMessage2(_window, message, targetOrigin); |
| 24982 } else { | 24982 } else { |
| 24983 _window.postMessage(message, targetOrigin, messagePorts); | 24983 _postMessage3(_window, message, targetOrigin, messagePorts); |
| 24984 } | 24984 } |
| 24985 } | 24985 } |
| 24986 | 24986 |
| 24987 // TODO(vsm): This is a hack to workaround dartbug.com/3175. We |
| 24988 // need a more robust convention to invoke JS methods on the |
| 24989 // underlying window. |
| 24990 static void _postMessage2(win, message, targetOrigin) native """ |
| 24991 win.postMessage(message, targetOrigin); |
| 24992 """; |
| 24993 |
| 24994 static void _postMessage3(win, message, targetOrigin, messagePorts) native """ |
| 24995 win.postMessage(message, targetOrigin, messagePorts); |
| 24996 """; |
| 24997 |
| 24987 // Implementation support. | 24998 // Implementation support. |
| 24988 _DOMWindowCrossFrameImpl(this._window); | 24999 _DOMWindowCrossFrameImpl(this._window); |
| 24989 | 25000 |
| 24990 static DOMWindow _createSafe(w) { | 25001 static DOMWindow _createSafe(w) { |
| 24991 if (w === window) { | 25002 if (w === window) { |
| 24992 return w; | 25003 return w; |
| 24993 } else { | 25004 } else { |
| 24994 // TODO(vsm): Cache or implement equality. | 25005 // TODO(vsm): Cache or implement equality. |
| 24995 return new _DOMWindowCrossFrameImpl(w); | 25006 return new _DOMWindowCrossFrameImpl(w); |
| 24996 } | 25007 } |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25343 if (length < 0) throw new IllegalArgumentException('length'); | 25354 if (length < 0) throw new IllegalArgumentException('length'); |
| 25344 if (start < 0) throw new IndexOutOfRangeException(start); | 25355 if (start < 0) throw new IndexOutOfRangeException(start); |
| 25345 int end = start + length; | 25356 int end = start + length; |
| 25346 if (end > a.length) throw new IndexOutOfRangeException(end); | 25357 if (end > a.length) throw new IndexOutOfRangeException(end); |
| 25347 for (int i = start; i < end; i++) { | 25358 for (int i = start; i < end; i++) { |
| 25348 accumulator.add(a[i]); | 25359 accumulator.add(a[i]); |
| 25349 } | 25360 } |
| 25350 return accumulator; | 25361 return accumulator; |
| 25351 } | 25362 } |
| 25352 } | 25363 } |
| OLD | NEW |