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

Unified Diff: test/codegen_expected/lib/convert/json_lib_test.js

Issue 2211293002: Reify type params on map literals (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Remove unnecessary null check Created 4 years, 4 months 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: test/codegen_expected/lib/convert/json_lib_test.js
diff --git a/test/codegen_expected/lib/convert/json_lib_test.js b/test/codegen_expected/lib/convert/json_lib_test.js
index e4dbe1f07c79ad627a262998da37636e4ad8e04e..5993ce4decbfc2a0747629150850ede5cb4baa37 100644
--- a/test/codegen_expected/lib/convert/json_lib_test.js
+++ b/test/codegen_expected/lib/convert/json_lib_test.js
@@ -19,7 +19,9 @@ dart_library.library('lib/convert/json_lib_test', null, /* Imports */[
let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(core.int)))();
let ListOfObject = () => (ListOfObject = dart.constFn(core.List$(core.Object)))();
let JSArrayOfListOfObject = () => (JSArrayOfListOfObject = dart.constFn(_interceptors.JSArray$(ListOfObject())))();
+ let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$(core.String, dart.dynamic)))();
let JSArrayOfMap = () => (JSArrayOfMap = dart.constFn(_interceptors.JSArray$(core.Map)))();
+ let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.String, core.int)))();
let JSArrayOfToJson = () => (JSArrayOfToJson = dart.constFn(_interceptors.JSArray$(json_lib_test.ToJson)))();
let isInstanceOfOfJsonUnsupportedObjectError = () => (isInstanceOfOfJsonUnsupportedObjectError = dart.constFn(src__matcher__core_matchers.isInstanceOf$(convert.JsonUnsupportedObjectError)))();
let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
@@ -46,16 +48,16 @@ dart_library.library('lib/convert/json_lib_test', null, /* Imports */[
src__matcher__expect.expect(convert.JSON.decode(' [ [3], [], [null], ["hi", true]] '), src__matcher__core_matchers.equals(JSArrayOfListOfObject().of([JSArrayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])])));
src__matcher__expect.expect(convert.JSON.decode(' {} '), src__matcher__core_matchers.isEmpty);
src__matcher__expect.expect(convert.JSON.decode('{ }'), src__matcher__core_matchers.isEmpty);
- src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi", u: true, v: false})));
- src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi" } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi"})));
- src__matcher__expect.expect(convert.JSON.decode(' {"y": -4.5, "z" : "hi" ,"x":3 } '), src__matcher__core_matchers.equals(dart.map({y: -4.5, z: "hi", x: 3})));
- src__matcher__expect.expect(convert.JSON.decode('{ " hi bob " :3, "": 4.5}'), src__matcher__core_matchers.equals(dart.map({" hi bob ": 3, "": 4.5})));
- src__matcher__expect.expect(convert.JSON.decode(' { "x" : { } } '), src__matcher__core_matchers.equals(dart.map({x: dart.map()})));
- src__matcher__expect.expect(convert.JSON.decode('{"x":{}}'), src__matcher__core_matchers.equals(dart.map({x: dart.map()})));
- src__matcher__expect.expect(convert.JSON.decode('{"w":null}'), src__matcher__core_matchers.equals(dart.map({w: null})));
- src__matcher__expect.expect(convert.JSON.decode('{"x":{"w":null}}'), src__matcher__core_matchers.equals(dart.map({x: dart.map({w: null})})));
- src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi",' + '"w":null, "u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi", w: null, u: true, v: false})));
- src__matcher__expect.expect(convert.JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], ' + '"z":"hi","w":{"c":null,"d":true}, "v":null}'), src__matcher__core_matchers.equals(dart.map({x: dart.map({a: 3, b: -4.5}), y: JSArrayOfMap().of([dart.map()]), z: "hi", w: dart.map({c: null, d: true}), v: null})));
+ src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi", u: true, v: false}, core.String, core.Object)));
+ src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi" } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi"}, core.String, core.Object)));
+ src__matcher__expect.expect(convert.JSON.decode(' {"y": -4.5, "z" : "hi" ,"x":3 } '), src__matcher__core_matchers.equals(dart.map({y: -4.5, z: "hi", x: 3}, core.String, core.Object)));
+ src__matcher__expect.expect(convert.JSON.decode('{ " hi bob " :3, "": 4.5}'), src__matcher__core_matchers.equals(dart.map({" hi bob ": 3, "": 4.5}, core.String, core.num)));
+ src__matcher__expect.expect(convert.JSON.decode(' { "x" : { } } '), src__matcher__core_matchers.equals(dart.map({x: dart.map()}, core.String, core.Map)));
+ src__matcher__expect.expect(convert.JSON.decode('{"x":{}}'), src__matcher__core_matchers.equals(dart.map({x: dart.map()}, core.String, core.Map)));
+ src__matcher__expect.expect(convert.JSON.decode('{"w":null}'), src__matcher__core_matchers.equals(dart.map({w: null}, core.String, dart.dynamic)));
+ src__matcher__expect.expect(convert.JSON.decode('{"x":{"w":null}}'), src__matcher__core_matchers.equals(dart.map({x: dart.map({w: null}, core.String, dart.dynamic)}, core.String, MapOfString$dynamic())));
+ src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi",' + '"w":null, "u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi", w: null, u: true, v: false}, core.String, core.Object)));
+ src__matcher__expect.expect(convert.JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], ' + '"z":"hi","w":{"c":null,"d":true}, "v":null}'), src__matcher__core_matchers.equals(dart.map({x: dart.map({a: 3, b: -4.5}, core.String, core.num), y: JSArrayOfMap().of([dart.map()]), z: "hi", w: dart.map({c: null, d: true}, core.String, core.bool), v: null}, core.String, core.Object)));
}, VoidTodynamic()));
unittest$.test('stringify', dart.fn(() => {
src__matcher__expect.expect(convert.JSON.encode(5), src__matcher__core_matchers.equals('5'));
@@ -76,15 +78,15 @@ dart_library.library('lib/convert/json_lib_test', null, /* Imports */[
src__matcher__expect.expect(convert.JSON.encode(JSArrayOfListOfObject().of([JSArrayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])])), src__matcher__core_matchers.equals('[[3],[],[null],["hi",true]]'));
src__matcher__expect.expect(convert.JSON.encode(dart.map()), src__matcher__core_matchers.equals('{}'));
src__matcher__expect.expect(convert.JSON.encode(core.Map.new()), src__matcher__core_matchers.equals('{}'));
- src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map()})), src__matcher__core_matchers.equals('{"x":{}}'));
- src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map({a: 3})})), src__matcher__core_matchers.equals('{"x":{"a":3}}'));
- json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi', w: null, u: true, v: false}));
- json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi'}));
- json_lib_test.validateRoundTrip(dart.map({' hi bob ': 3, '': 4.5}));
- json_lib_test.validateRoundTrip(dart.map({x: dart.map({a: 3, b: -4.5}), y: JSArrayOfMap().of([dart.map()]), z: 'hi', w: dart.map({c: null, d: true}), v: null}));
+ src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map()}, core.String, core.Map)), src__matcher__core_matchers.equals('{"x":{}}'));
+ src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map({a: 3}, core.String, core.int)}, core.String, MapOfString$int())), src__matcher__core_matchers.equals('{"x":{"a":3}}'));
+ json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi', w: null, u: true, v: false}, core.String, core.Object));
+ json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi'}, core.String, core.Object));
+ json_lib_test.validateRoundTrip(dart.map({' hi bob ': 3, '': 4.5}, core.String, core.num));
+ json_lib_test.validateRoundTrip(dart.map({x: dart.map({a: 3, b: -4.5}, core.String, core.num), y: JSArrayOfMap().of([dart.map()]), z: 'hi', w: dart.map({c: null, d: true}, core.String, core.bool), v: null}, core.String, core.Object));
src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(4)), "4");
src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(JSArrayOfObject().of([4, "a"]))), '[4,"a"]');
- src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(JSArrayOfObject().of([4, new json_lib_test.ToJson(dart.map({x: 42}))]))), '[4,{"x":42}]');
+ src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(JSArrayOfObject().of([4, new json_lib_test.ToJson(dart.map({x: 42}, core.String, core.int))]))), '[4,{"x":42}]');
src__matcher__expect.expect(dart.fn(() => {
convert.JSON.encode(JSArrayOfToJson().of([new json_lib_test.ToJson(new json_lib_test.ToJson(4))]));
}, VoidTodynamic()), json_lib_test.throwsJsonError);

Powered by Google App Engine
This is Rietveld 408576698