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

Side by Side Diff: pkg/dev_compiler/test/codegen_expected/script.js

Issue 2926613003: Generate better code for '=='. (Closed)
Patch Set: Address comments Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 define(['dart_sdk'], function(dart_sdk) { 1 define(['dart_sdk'], function(dart_sdk) {
2 'use strict'; 2 'use strict';
3 const core = dart_sdk.core; 3 const core = dart_sdk.core;
4 const dart = dart_sdk.dart; 4 const dart = dart_sdk.dart;
5 const dartx = dart_sdk.dartx; 5 const dartx = dart_sdk.dartx;
6 const script = Object.create(null); 6 const script = Object.create(null);
7 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String)) )(); 7 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String)) )();
8 let ListOfStringTovoid = () => (ListOfStringTovoid = dart.constFn(dart.fnType( dart.void, [ListOfString()])))(); 8 let ListOfStringTovoid = () => (ListOfStringTovoid = dart.constFn(dart.fnType( dart.void, [ListOfString()])))();
9 script.main = function(args) { 9 script.main = function(args) {
10 let name = args[dartx.join](' '); 10 let name = args[dartx.join](' ');
11 if (name == '') name = 'world'; 11 if (name === '') name = 'world';
12 core.print(dart.str`hello ${name}`); 12 core.print(dart.str`hello ${name}`);
13 }; 13 };
14 dart.fn(script.main, ListOfStringTovoid()); 14 dart.fn(script.main, ListOfStringTovoid());
15 dart.trackLibraries("script", { 15 dart.trackLibraries("script", {
16 "script.dart": script 16 "script.dart": script
17 }, null); 17 }, null);
18 // Exports: 18 // Exports:
19 return { 19 return {
20 script: script 20 script: script
21 }; 21 };
22 }); 22 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698