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

Issue 2386493003: Fix type errors in math.min() and math.max(). (Closed)

Created:
4 years, 2 months ago by Bob Nystrom
Modified:
4 years, 2 months ago
Reviewers:
vsm
CC:
dev-compiler+reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix type errors in math.min() and math.max(). Really, this works around them, but the workaround is all round better code. Remove the Dart implementations of min() and max() and just forward to the JS ones. In DDC, all numbers are double, so the type checks to handle them specifically aren't meaningful. Also, we don't need the other special case checks in there to help dart2js optimize them. R=vsm@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/20e402c43dfbcad502f794eecab81f311c421fb7

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -176 lines) Patch
M pkg/dev_compiler/lib/js/amd/dart_sdk.js View 1 chunk +2 lines, -29 lines 0 comments Download
M pkg/dev_compiler/lib/js/common/dart_sdk.js View 1 chunk +2 lines, -29 lines 0 comments Download
M pkg/dev_compiler/lib/js/es6/dart_sdk.js View 1 chunk +2 lines, -29 lines 0 comments Download
M pkg/dev_compiler/lib/js/legacy/dart_sdk.js View 1 chunk +2 lines, -29 lines 0 comments Download
M pkg/dev_compiler/tool/input_sdk/lib/math/math.dart View 3 chunks +4 lines, -56 lines 0 comments Download
M pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart View 1 chunk +8 lines, -0 lines 2 comments Download
M pkg/dev_compiler/tool/sdk_expected_errors.txt View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Bob Nystrom
4 years, 2 months ago (2016-09-30 19:33:32 UTC) #2
vsm
lgtm! https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart File pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart (right): https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart#newcode12 pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart:12: => JS('num', r'Math.min(#, #)', checkNum(a), checkNum(b)) as num/*=T*/; ...
4 years, 2 months ago (2016-09-30 19:36:33 UTC) #3
Bob Nystrom
https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart File pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart (right): https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart#newcode12 pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart:12: => JS('num', r'Math.min(#, #)', checkNum(a), checkNum(b)) as num/*=T*/; On ...
4 years, 2 months ago (2016-09-30 19:43:14 UTC) #4
vsm
On 2016/09/30 19:43:14, Bob Nystrom wrote: > https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart > File pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart (right): > > https://codereview.chromium.org/2386493003/diff/1/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart#newcode12 ...
4 years, 2 months ago (2016-09-30 19:45:56 UTC) #5
Bob Nystrom
4 years, 2 months ago (2016-09-30 20:18:12 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
20e402c43dfbcad502f794eecab81f311c421fb7 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698