Change void typed setters in html_dart2js not to return a value.

Even though the return value of a setter is ignored, it must be checked against the declared return type in checked mode since setters are evaluated like normal functions (see Specification, 16.12).

BUG= http://dartbug.com/20381
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//443883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38925 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
karlklose@google.com 2014-08-06 10:48:01 +00:00
parent bc05c60051
commit 7ff889c209
4 changed files with 26 additions and 16 deletions

View file

@ -2169,8 +2169,6 @@ class BlinkFileReader {
static $readyState_Getter(mthis) native "FileReader_readyState_Getter";
static $result_Getter(mthis) native "FileReader_result_Getter";
static $abort_Callback(mthis) native "FileReader_abort_Callback_RESOLVER_STRING_0_";
static $readAsArrayBuffer_Callback(mthis, blob) native "FileReader_readAsArrayBuffer_Callback_RESOLVER_STRING_1_Blob";
@ -8133,10 +8131,10 @@ class BlinkURL {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return $_createObjectURL_1_Callback(blob_OR_source_OR_stream);
}
if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
return $_createObjectURL_2_Callback(blob_OR_source_OR_stream);
}
if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
return $_createObjectURL_3_Callback(blob_OR_source_OR_stream);
}
throw new ArgumentError("Incorrect number or type of arguments");
@ -8144,9 +8142,9 @@ class BlinkURL {
static $_createObjectURL_1_Callback(blob_OR_source_OR_stream) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_Blob";
static $_createObjectURL_2_Callback(blob_OR_source_OR_stream) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_MediaSource";
static $_createObjectURL_2_Callback(blob_OR_source_OR_stream) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_MediaStream";
static $_createObjectURL_3_Callback(blob_OR_source_OR_stream) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_MediaStream";
static $_createObjectURL_3_Callback(blob_OR_source_OR_stream) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_MediaSource";
static $createObjectUrlFromBlob_Callback(blob) native "URL_createObjectURL_Callback_RESOLVER_STRING_1_Blob";

View file

@ -1934,9 +1934,11 @@ class CanvasRenderingContext2D extends CanvasRenderingContext {
@DomName('CanvasRenderingContext2D.lineDashOffset')
// TODO(14316): Firefox has this functionality with mozDashOffset, but it
// needs to be polyfilled.
void set lineDashOffset(num value) => JS('void',
'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
'#.webkitLineDashOffset = #', this, this, value, this, value);
void set lineDashOffset(num value) {
JS('void',
'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
'#.webkitLineDashOffset = #', this, this, value, this, value);
}
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@ -10309,7 +10311,9 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
@DomName('Element.scrollLeft')
@DocsEditable()
void set scrollLeft(int value) => JS("void", "#.scrollLeft = #", this, value.round());
void set scrollLeft(int value) {
JS("void", "#.scrollLeft = #", this, value.round());
}
@DomName('Element.scrollTop')
@DocsEditable()
@ -10317,7 +10321,9 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
@DomName('Element.scrollTop')
@DocsEditable()
void set scrollTop(int value) => JS("void", "#.scrollTop = #", this, value.round());
void set scrollTop(int value) {
JS("void", "#.scrollTop = #", this, value.round());
}
@DomName('Element.scrollWidth')
@DocsEditable()

View file

@ -270,9 +270,11 @@ $if DART2JS
@DomName('CanvasRenderingContext2D.lineDashOffset')
// TODO(14316): Firefox has this functionality with mozDashOffset, but it
// needs to be polyfilled.
void set lineDashOffset(num value) => JS('void',
'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
'#.webkitLineDashOffset = #', this, this, value, this, value);
void set lineDashOffset(num value) {
JS('void',
'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
'#.webkitLineDashOffset = #', this, this, value, this, value);
}
$else
// TODO(amouravski): Add Dartium native methods for drawImage once we figure
// out how to not break native bindings.

View file

@ -1368,7 +1368,9 @@ $if DART2JS
@DomName('Element.scrollLeft')
@DocsEditable()
void set scrollLeft(int value) => JS("void", "#.scrollLeft = #", this, value.round());
void set scrollLeft(int value) {
JS("void", "#.scrollLeft = #", this, value.round());
}
@DomName('Element.scrollTop')
@DocsEditable()
@ -1376,7 +1378,9 @@ $if DART2JS
@DomName('Element.scrollTop')
@DocsEditable()
void set scrollTop(int value) => JS("void", "#.scrollTop = #", this, value.round());
void set scrollTop(int value) {
JS("void", "#.scrollTop = #", this, value.round());
}
@DomName('Element.scrollWidth')
@DocsEditable()