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

Unified Diff: lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate

Issue 11094082: Convert legacy 'native code' to JS-forms in dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
diff --git a/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
index c120b45a7a4d1eb7d04224b85be0bbc9eb4e31a4..d903761ddbb43f81e6f5cc094a5d9efc1e5813a2 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
@@ -3,11 +3,14 @@
// BSD-style license that can be found in the LICENSE file.
class $FACTORYPROVIDER {
- static DataView createDataView(ArrayBuffer buffer,
- [int byteOffset = null, int byteLength = null])
- native '''
- if (byteOffset == null) return new DataView(buffer);
- if (byteLength == null) return new DataView(buffer, byteOffset);
- return new DataView(buffer, byteOffset, byteLength);
- ''';
+ static DataView createDataView(
+ ArrayBuffer buffer, [int byteOffset = null, int byteLength = null]) {
+ if (byteOffset == null) {
+ return JS('DataView', 'new DataView(#)', buffer);
+ }
+ if (byteLength == null) {
+ return JS('DataView', 'new DataView(#,#)', buffer, byteOffset);
+ }
+ return JS('DataView', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698