Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioNode.connect arguments don't match spec #2023

Closed
danrubel opened this issue Mar 6, 2012 · 11 comments
Closed

AudioNode.connect arguments don't match spec #2023

danrubel opened this issue Mar 6, 2012 · 11 comments
Assignees
Labels
web-libraries Issues impacting dart:html, etc., libraries
Milestone

Comments

@danrubel
Copy link

danrubel commented Mar 6, 2012

[user feedback]
In dart:html AudioNode.connet() arguments spec, I can ommit "input" and "output". But, In output js by dartc, I can't it.
////////////////////////////////////////////////////////////////////////////////////
Editor Version: 3934

@DartBot
Copy link

DartBot commented Sep 13, 2012

This comment was originally written by jjinux...@google.com


I'm looking at (https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNode-section), and it says:

interface AudioNode {
    void connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
    void connect(AudioParam destination, optional unsigned long output = 0);
    ...
}

However, when I look at html_dartium.dart, I see:

void connect(destination, int output, [int input]);

I think those don't match. Looking at the HTML5 Rocks example, they're only passing one argument.


Removed Area-Library label.
Added Area-HTML label.
Changed the title to: "AudioNode.connect arguments don't match spec".

@DartBot
Copy link

DartBot commented Sep 14, 2012

@blois
Copy link
Contributor

blois commented Oct 15, 2012

Set owner to @efortuna.
Added this to the M2 milestone.

@efortuna
Copy link
Contributor

@jjinux:
This is actually the correct API. In JavaScript if we just call AudioNode.connect(dest) the other "optional" arguments have the value of undefined. For all APIs in which a user might not pass in in input (where the argument is optional but the default value would be "undefined" in javascript), (see window.alert() for an example), the corresponding Dart API "requires" these parameters and the user can pass in null if they want the same "nothing" behavior.

So when we "merge" the two connect function calls, both have "output" as "optional/undefined" but only one has "input". So input gets marked as "Dart Optional", but you pass in null if you don't want to have an output.


Added AsDesigned label.

@DartBot
Copy link

DartBot commented Nov 7, 2012

This comment was originally written by jjinux...@google.com


Thanks for the explanation. I changed all my 0s to nulls, and everything worked correctly under both Dartium and dart2js. Thanks again!

@DartBot
Copy link

DartBot commented Jan 31, 2013

This comment was originally written by jjinu...@gmail.com


Ugh, the behavior of this has reversed and my code broke. I had to change all the nulls back to 0s to get it to work :-/

@efortuna
Copy link
Contributor

Investigating...

it the situation like this: http://code.google.com/p/dart/issues/detail?id=6728 ? If so, in the case it's being used in the bug report, the third argument is not actually optional, and the API is again correct. I haven't closed that bug because I need to write better documentation explaining this. I'll include you on that change when I get it in.

@DartBot
Copy link

DartBot commented Feb 5, 2013

This comment was originally written by jjinux...@google.com


Hey, Emily, thanks for taking a look at this again. Read comments 4, 5, and 6 to fully understand what changed. Thanks!

@efortuna
Copy link
Contributor

efortuna commented Feb 7, 2013

(reopening to investigate)


Removed this from the M2 milestone.
Added this to the M3 milestone.
Added Accepted label.

@DartBot
Copy link

DartBot commented Feb 13, 2013

@efortuna
Copy link
Contributor

closing this bug since this bug: https://code.google.com/p/dart/issues/detail?id=8120 has been opened about the same issue.


Removed this from the M3 milestone.
Added this to the M2 milestone.
Added Fixed label.

@danrubel danrubel added Type-Defect web-libraries Issues impacting dart:html, etc., libraries labels Feb 14, 2013
@danrubel danrubel added this to the M2 milestone Feb 14, 2013
copybara-service bot pushed a commit that referenced this issue May 30, 2023
…buf, shelf, test, tools, vector_math, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/59dc475..1d94484):
  1d94484c  2023-05-29  dependabot[bot]  Bump github/codeql-action from 2.3.3 to 2.3.5 (#3422)
  0edc1a71  2023-05-28  dependabot[bot]  Bump http from 0.13.6 to 1.0.0 (#3421)

http (https://github.com/dart-lang/http/compare/dfec389..8a4a4a6):
  8a4a4a6  2023-05-25  Brian Quinlan  Add a better toString to _ClientSocketException (#948)
  5c1f1ad  2023-05-25  Devon Carew  regenerate with the latest mono_repo (#947)

leak_tracker (https://github.com/dart-lang/leak_tracker/compare/9c6e9b3..7f2cab3):
  7f2cab3  2023-05-26  Polina Cherkasova  Nicely format retaining path. (#68)

lints (https://github.com/dart-lang/lints/compare/72f107a..4236c43):
  4236c43  2023-05-26  Parker Lougheed  Remove pedantic from README (#124)
  4ac79d8  2023-05-24  Parker Lougheed  Update example for latest lints version (#123)

mockito (https://github.com/dart-lang/mockito/compare/153c145..40fe2ca):
  40fe2ca  2023-05-25  Nate Bosch  Expand constraint on package:http

native (https://github.com/dart-lang/native/compare/45e16dc..76bc55e):
  76bc55e  2023-05-30  Daco Harkes  [c_compiler] Target ios_x64 (#53)

protobuf (https://github.com/dart-lang/protobuf/compare/7d2d293..346a72d):
  346a72d  2023-05-30  Ömer Sinan Ağacan  Fix generated ignore_for_file directives (#833)
  35ea45f  2023-05-26  Kevin Moore  Latest mono_repo (#834)

shelf (https://github.com/dart-lang/shelf/compare/56919a1..a404b6a):
  a404b6a  2023-05-25  Devon Carew  re-generate w/ the latest monorepo (#362)

test (https://github.com/dart-lang/test/compare/309596e..3276921):
  32769215  2023-05-25  dependabot[bot]  Bump github/codeql-action from 2.3.2 to 2.3.5 (#2023)
  f74e85c8  2023-05-25  dependabot[bot]  Bump dart-lang/setup-dart from 1.3.0 to 1.5.0 (#2022)
  4b2bd272  2023-05-25  Devon Carew  update the mono_repo and dependabot configs (#2021)

tools (https://github.com/dart-lang/tools/compare/81ff996..b90a7e8):
  b90a7e8  2023-05-26  Devon Carew  blast_repo fixes (#106)

vector_math (https://github.com/google/vector_math.dart/compare/e3de8da..cd87f57):
  cd87f57  2023-05-30  JKris95  Axis calculation of quaternions from small angles (#272)
  3762b25  2023-05-30  Lukas Klingsbo  Removes the `new` keyword from readme (#284)
  df5877f  2023-05-30  Lukas Klingsbo  Use named constructors in Vector2 and some general optimizations (#289)

webdev (https://github.com/dart-lang/webdev/compare/d74fadd..4b69f1d):
  4b69f1dd  2023-05-26  Anna Gringauze  fix format breaking tests (#2124)
  b75f8e62  2023-05-25  Devon Carew  re-generate w/ the latest monorepo (#2121)

Change-Id: Ide9b7781102b654db15114d01cd4fbca40478906
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306304
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

4 participants