| Index: lib/runtime/dart/convert.js
|
| diff --git a/lib/runtime/dart/convert.js b/lib/runtime/dart/convert.js
|
| index b88f897d32f28a730779ac110dc8e6dce58bc7bd..c9589b48df339dcc05c32444c5a2604089579e1e 100644
|
| --- a/lib/runtime/dart/convert.js
|
| +++ b/lib/runtime/dart/convert.js
|
| @@ -65,16 +65,14 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| });
|
| let _allowInvalid = Symbol('_allowInvalid');
|
| class AsciiCodec extends Encoding {
|
| - AsciiCodec(opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
|
| + AsciiCodec({allowInvalid = false} = {}) {
|
| this[_allowInvalid] = allowInvalid;
|
| super.Encoding();
|
| }
|
| get name() {
|
| return "us-ascii";
|
| }
|
| - decode(bytes, opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : null;
|
| + decode(bytes, {allowInvalid = null} = {}) {
|
| if (allowInvalid == null)
|
| allowInvalid = this[_allowInvalid];
|
| if (dart.notNull(allowInvalid)) {
|
| @@ -278,8 +276,7 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| })
|
| });
|
| class AsciiDecoder extends _UnicodeSubsetDecoder {
|
| - AsciiDecoder(opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
|
| + AsciiDecoder({allowInvalid = false} = {}) {
|
| super._UnicodeSubsetDecoder(allowInvalid, _ASCII_MASK);
|
| }
|
| startChunkedConversion(sink) {
|
| @@ -781,8 +778,7 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| })
|
| });
|
| class JsonUnsupportedObjectError extends core.Error {
|
| - JsonUnsupportedObjectError(unsupportedObject, opts) {
|
| - let cause = opts && 'cause' in opts ? opts.cause : null;
|
| + JsonUnsupportedObjectError(unsupportedObject, {cause = null} = {}) {
|
| this.unsupportedObject = unsupportedObject;
|
| this.cause = cause;
|
| super.Error();
|
| @@ -812,9 +808,7 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| let _reviver = Symbol('_reviver');
|
| let _toEncodable$ = Symbol('_toEncodable');
|
| class JsonCodec extends Codec$(core.Object, core.String) {
|
| - JsonCodec(opts) {
|
| - let reviver = opts && 'reviver' in opts ? opts.reviver : null;
|
| - let toEncodable = opts && 'toEncodable' in opts ? opts.toEncodable : null;
|
| + JsonCodec({reviver = null, toEncodable = null} = {}) {
|
| this[_reviver] = reviver;
|
| this[_toEncodable$] = toEncodable;
|
| super.Codec();
|
| @@ -822,16 +816,14 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| withReviver(reviver) {
|
| this.JsonCodec({reviver: reviver});
|
| }
|
| - decode(source, opts) {
|
| - let reviver = opts && 'reviver' in opts ? opts.reviver : null;
|
| + decode(source, {reviver = null} = {}) {
|
| if (reviver == null)
|
| reviver = this[_reviver];
|
| if (reviver == null)
|
| return this.decoder.convert(source);
|
| return new JsonDecoder(reviver).convert(source);
|
| }
|
| - encode(value, opts) {
|
| - let toEncodable = opts && 'toEncodable' in opts ? opts.toEncodable : null;
|
| + encode(value, {toEncodable = null} = {}) {
|
| if (toEncodable == null)
|
| toEncodable = this[_toEncodable$];
|
| if (toEncodable == null)
|
| @@ -1560,16 +1552,14 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| let __CastType2 = dart.typedef('__CastType2', () => dart.functionType(dart.dynamic, [dart.dynamic]));
|
| let __CastType4 = dart.typedef('__CastType4', () => dart.functionType(dart.dynamic, [core.Object]));
|
| class Latin1Codec extends Encoding {
|
| - Latin1Codec(opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
|
| + Latin1Codec({allowInvalid = false} = {}) {
|
| this[_allowInvalid] = allowInvalid;
|
| super.Encoding();
|
| }
|
| get name() {
|
| return "iso-8859-1";
|
| }
|
| - decode(bytes, opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : null;
|
| + decode(bytes, {allowInvalid = null} = {}) {
|
| if (allowInvalid == null)
|
| allowInvalid = this[_allowInvalid];
|
| if (dart.notNull(allowInvalid)) {
|
| @@ -1600,8 +1590,7 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| constructors: () => ({Latin1Encoder: [Latin1Encoder, []]})
|
| });
|
| class Latin1Decoder extends _UnicodeSubsetDecoder {
|
| - Latin1Decoder(opts) {
|
| - let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
|
| + Latin1Decoder({allowInvalid = false} = {}) {
|
| super._UnicodeSubsetDecoder(allowInvalid, _LATIN1_MASK);
|
| }
|
| startChunkedConversion(sink) {
|
| @@ -2069,16 +2058,14 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| let UNICODE_BOM_CHARACTER_RUNE = 65279;
|
| let _allowMalformed = Symbol('_allowMalformed');
|
| class Utf8Codec extends Encoding {
|
| - Utf8Codec(opts) {
|
| - let allowMalformed = opts && 'allowMalformed' in opts ? opts.allowMalformed : false;
|
| + Utf8Codec({allowMalformed = false} = {}) {
|
| this[_allowMalformed] = allowMalformed;
|
| super.Encoding();
|
| }
|
| get name() {
|
| return "utf-8";
|
| }
|
| - decode(codeUnits, opts) {
|
| - let allowMalformed = opts && 'allowMalformed' in opts ? opts.allowMalformed : null;
|
| + decode(codeUnits, {allowMalformed = null} = {}) {
|
| if (allowMalformed == null)
|
| allowMalformed = this[_allowMalformed];
|
| return new Utf8Decoder({allowMalformed: allowMalformed}).convert(codeUnits);
|
| @@ -2334,8 +2321,7 @@ dart_library.library('dart/convert', null, /* Imports */[
|
| })
|
| });
|
| class Utf8Decoder extends Converter$(core.List$(core.int), core.String) {
|
| - Utf8Decoder(opts) {
|
| - let allowMalformed = opts && 'allowMalformed' in opts ? opts.allowMalformed : false;
|
| + Utf8Decoder({allowMalformed = false} = {}) {
|
| this[_allowMalformed] = allowMalformed;
|
| super.Converter();
|
| }
|
|
|