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

Unified Diff: lib/html/templates/html/impl/impl_AudioContext.darttemplate

Issue 11358042: Make new audionode names backwards compatible. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/impl/impl_AudioContext.darttemplate
===================================================================
--- lib/html/templates/html/impl/impl_AudioContext.darttemplate (revision 0)
+++ lib/html/templates/html/impl/impl_AudioContext.darttemplate (working copy)
@@ -0,0 +1,41 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$!MEMBERS
+$if DART2JS
+ void createGain() {
sra1 2012/11/01 20:59:40 not 'void'. GainNode?
+ if (JS('bool', '#.createGain !== undefined', this)) {
+ return JS('void', '#.createGain()', this);
sra1 2012/11/01 20:59:40 Ditto about void.
+ } else {
+ return JS('void', '#.createGainNode()', this);
+ }
+ }
+
+ void createScriptProcessor(int bufferSize, [int numberOfInputChannels, int
+ numberOfOutputChannels]) {
Emily Fortuna 2012/11/01 18:38:58 One would think there would be a more concise way
sra1 2012/11/01 20:59:40 In JS, you can replace x.foo(y); with var m =
+ if (JS('bool', '#.createScriptProcessor !== undefined', this)) {
+ if (?numberOfOutputChannels) {
+ return JS('void', '#.createScriptProcessor(#, #, #)', this, bufferSize,
+ numberOfInputChannels, numberOfOutputChannels);
+ } else if (?numberOfInputChannels) {
+ return JS('void', '#.createScriptProcessor(#, #)', this, bufferSize,
+ numberOfInputChannels);
+ } else {
+ return JS('void', '#.createScriptProcessor(#)', this, bufferSize);
+ }
+ } else {
+ if (?numberOfOutputChannels) {
+ return JS('void', '#.createJavaScriptNode(#, #, #)', this, bufferSize,
+ numberOfInputChannels, numberOfOutputChannels);
+ } else if (?numberOfInputChannels) {
+ return JS('void', '#.createJavaScriptNode(#, #)', this, bufferSize,
+ numberOfInputChannels);
+ } else {
+ return JS('void', '#.createJavaScriptNode(#)', this, bufferSize);
+ }
+ }
+ }
+$endif
+}

Powered by Google App Engine
This is Rietveld 408576698