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

Side by Side Diff: test/codegen/expect/math/math.js

Issue 955513008: cleans up sdk patching so we no longer have unresolved names (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « test/codegen/expect/isolate/isolate.js ('k') | test/codegen/expect/typed_data/typed_data.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var math; 1 var math;
2 (function(math) { 2 (function(math) {
3 'use strict'; 3 'use strict';
4 let E = 2.718281828459045; 4 let E = 2.718281828459045;
5 let LN10 = 2.302585092994046; 5 let LN10 = 2.302585092994046;
6 let LN2 = 0.6931471805599453; 6 let LN2 = 0.6931471805599453;
7 let LOG2E = 1.4426950408889634; 7 let LOG2E = 1.4426950408889634;
8 let LOG10E = 0.4342944819032518; 8 let LOG10E = 0.4342944819032518;
9 let PI = 3.141592653589793; 9 let PI = 3.141592653589793;
10 let SQRT1_2 = 0.7071067811865476; 10 let SQRT1_2 = 0.7071067811865476;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (b.isNaN) 50 if (b.isNaN)
51 return b; 51 return b;
52 return a; 52 return a;
53 } 53 }
54 if (dart.notNull(b === 0) && dart.notNull(a.isNegative)) 54 if (dart.notNull(b === 0) && dart.notNull(a.isNegative))
55 return b; 55 return b;
56 return a; 56 return a;
57 } 57 }
58 // Function atan2: (num, num) → double 58 // Function atan2: (num, num) → double
59 function atan2(a, b) { 59 function atan2(a, b) {
60 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.atan2(#, #)', dart.dinvokef(/* Unimplemented unknown name */checkNum, a), d art.dinvokef(/* Unimplemented unknown name */checkNum, b)), core.double); 60 return dart.as(_foreign_helper.JS('double', 'Math.atan2(#, #)', _js_helper.c heckNum(a), _js_helper.checkNum(b)), core.double);
61 } 61 }
62 // Function pow: (num, num) → num 62 // Function pow: (num, num) → num
63 function pow(x, exponent) { 63 function pow(x, exponent) {
64 dart.dinvokef(/* Unimplemented unknown name */checkNum, x); 64 _js_helper.checkNum(x);
65 dart.dinvokef(/* Unimplemented unknown name */checkNum, exponent); 65 _js_helper.checkNum(exponent);
66 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'num', 'Mat h.pow(#, #)', x, exponent), core.num); 66 return dart.as(_foreign_helper.JS('num', 'Math.pow(#, #)', x, exponent), cor e.num);
67 } 67 }
68 // Function sin: (num) → double 68 // Function sin: (num) → double
69 function sin(x) { 69 function sin(x) {
70 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.sin(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core. double); 70 return dart.as(_foreign_helper.JS('double', 'Math.sin(#)', _js_helper.checkN um(x)), core.double);
71 } 71 }
72 // Function cos: (num) → double 72 // Function cos: (num) → double
73 function cos(x) { 73 function cos(x) {
74 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.cos(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core. double); 74 return dart.as(_foreign_helper.JS('double', 'Math.cos(#)', _js_helper.checkN um(x)), core.double);
75 } 75 }
76 // Function tan: (num) → double 76 // Function tan: (num) → double
77 function tan(x) { 77 function tan(x) {
78 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.tan(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core. double); 78 return dart.as(_foreign_helper.JS('double', 'Math.tan(#)', _js_helper.checkN um(x)), core.double);
79 } 79 }
80 // Function acos: (num) → double 80 // Function acos: (num) → double
81 function acos(x) { 81 function acos(x) {
82 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.acos(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core .double); 82 return dart.as(_foreign_helper.JS('double', 'Math.acos(#)', _js_helper.check Num(x)), core.double);
83 } 83 }
84 // Function asin: (num) → double 84 // Function asin: (num) → double
85 function asin(x) { 85 function asin(x) {
86 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.asin(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core .double); 86 return dart.as(_foreign_helper.JS('double', 'Math.asin(#)', _js_helper.check Num(x)), core.double);
87 } 87 }
88 // Function atan: (num) → double 88 // Function atan: (num) → double
89 function atan(x) { 89 function atan(x) {
90 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.atan(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core .double); 90 return dart.as(_foreign_helper.JS('double', 'Math.atan(#)', _js_helper.check Num(x)), core.double);
91 } 91 }
92 // Function sqrt: (num) → double 92 // Function sqrt: (num) → double
93 function sqrt(x) { 93 function sqrt(x) {
94 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.sqrt(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core .double); 94 return dart.as(_foreign_helper.JS('double', 'Math.sqrt(#)', _js_helper.check Num(x)), core.double);
95 } 95 }
96 // Function exp: (num) → double 96 // Function exp: (num) → double
97 function exp(x) { 97 function exp(x) {
98 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.exp(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core. double); 98 return dart.as(_foreign_helper.JS('double', 'Math.exp(#)', _js_helper.checkN um(x)), core.double);
99 } 99 }
100 // Function log: (num) → double 100 // Function log: (num) → double
101 function log(x) { 101 function log(x) {
102 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, 'double', ' Math.log(#)', dart.dinvokef(/* Unimplemented unknown name */checkNum, x)), core. double); 102 return dart.as(_foreign_helper.JS('double', 'Math.log(#)', _js_helper.checkN um(x)), core.double);
103 } 103 }
104 let _POW2_32 = 4294967296; 104 let _POW2_32 = 4294967296;
105 class _JSRandom extends dart.Object { 105 class _JSRandom extends dart.Object {
106 _JSRandom() { 106 _JSRandom() {
107 } 107 }
108 nextInt(max) { 108 nextInt(max) {
109 if (dart.notNull(max <= 0) || dart.notNull(max > _POW2_32)) { 109 if (dart.notNull(max <= 0) || dart.notNull(max > _POW2_32)) {
110 throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${ma x}`); 110 throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${ma x}`);
111 } 111 }
112 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, "int", "( Math.random() * #) >>> 0", max), core.int); 112 return dart.as(_foreign_helper.JS("int", "(Math.random() * #) >>> 0", max) , core.int);
113 } 113 }
114 nextDouble() { 114 nextDouble() {
115 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, "double", "Math.random()"), core.double); 115 return dart.as(_foreign_helper.JS("double", "Math.random()"), core.double) ;
116 } 116 }
117 nextBool() { 117 nextBool() {
118 return dart.as(dart.dinvokef(/* Unimplemented unknown name */JS, "bool", " Math.random() < 0.5"), core.bool); 118 return dart.as(_foreign_helper.JS("bool", "Math.random() < 0.5"), core.boo l);
119 } 119 }
120 } 120 }
121 class _Random extends dart.Object { 121 class _Random extends dart.Object {
122 _Random(seed) { 122 _Random(seed) {
123 this._lo = 0; 123 this._lo = 0;
124 this._hi = 0; 124 this._hi = 0;
125 let empty_seed = 0; 125 let empty_seed = 0;
126 if (seed < 0) { 126 if (seed < 0) {
127 empty_seed = -1; 127 empty_seed = -1;
128 } 128 }
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 math.exp = exp; 438 math.exp = exp;
439 math.log = log; 439 math.log = log;
440 math.Point = Point; 440 math.Point = Point;
441 math.Point$ = Point$; 441 math.Point$ = Point$;
442 math.Random = Random; 442 math.Random = Random;
443 math.Rectangle = Rectangle; 443 math.Rectangle = Rectangle;
444 math.Rectangle$ = Rectangle$; 444 math.Rectangle$ = Rectangle$;
445 math.MutableRectangle = MutableRectangle; 445 math.MutableRectangle = MutableRectangle;
446 math.MutableRectangle$ = MutableRectangle$; 446 math.MutableRectangle$ = MutableRectangle$;
447 })(math || (math = {})); 447 })(math || (math = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/isolate/isolate.js ('k') | test/codegen/expect/typed_data/typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698