Chromium Code Reviews| 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 |
| +} |