| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d036b35 commit 9ef81ff
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 4 | |
| 12 | 12 | #define V8_MINOR_VERSION 6 | |
| 13 | 13 | #define V8_BUILD_NUMBER 85 | |
| 14 | - #define V8_PATCH_LEVEL 28 | ||
| 14 | + #define V8_PATCH_LEVEL 31 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2819,6 +2819,8 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) { | |||
| 2819 | 2819 | ||
| 2820 | 2820 | void LCodeGen::DoDrop(LDrop* instr) { | |
| 2821 | 2821 | __ Drop(instr->count()); | |
| 2822 | + | ||
| 2823 | + RecordPushedArgumentsDelta(instr->hydrogen_value()->argument_delta()); | ||
| 2822 | 2824 | } | |
| 2823 | 2825 | ||
| 2824 | 2826 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1103,14 +1103,15 @@ function initializeNumberFormat(numberFormat, locales, options) { | |||
| 1103 | 1103 | ||
| 1104 | 1104 | var mnfd = options['minimumFractionDigits']; | |
| 1105 | 1105 | var mxfd = options['maximumFractionDigits']; | |
| 1106 | - if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') { | ||
| 1106 | + if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') { | ||
| 1107 | 1107 | mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); | |
| 1108 | 1108 | defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); | |
| 1109 | 1109 | } | |
| 1110 | 1110 | ||
| 1111 | - if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') { | ||
| 1111 | + if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') { | ||
| 1112 | + var min_mxfd = internalOptions.style === 'percent' ? 0 : 3; | ||
| 1112 | 1113 | mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; | |
| 1113 | - fallback_limit = (mnfd > 3) ? mnfd : 3; | ||
| 1114 | + fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd; | ||
| 1114 | 1115 | mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_limit); | |
| 1115 | 1116 | defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); | |
| 1116 | 1117 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,56 @@ | |||
| 2 | 2 | // Use of this source code is governed by a BSD-style license that can be | |
| 3 | 3 | // found in the LICENSE file. | |
| 4 | 4 | ||
| 5 | - // Make sure minimumFractionDigits is honored | ||
| 5 | + // Make sure minimumFractionDigits and maximumFractionDigits are honored | ||
| 6 | 6 | ||
| 7 | - var nf = new Intl.NumberFormat("en-us",{ useGrouping: false, minimumFractionDigits: 4}); | ||
| 7 | + var nf = new Intl.NumberFormat("en-us", { useGrouping: false, minimumFractionDigits: 4, maximumFractionDigits: 8}); | ||
| 8 | 8 | ||
| 9 | 9 | assertEquals("12345.6789", nf.format(12345.6789)); | |
| 10 | + assertEquals("12345.678912", nf.format(12345.678912)); | ||
| 11 | + assertEquals("12345.6700", nf.format(12345.67)); | ||
| 12 | + assertEquals("12345.67891234", nf.format(12345.6789123421)); | ||
| 13 | + | ||
| 14 | + nf = new Intl.NumberFormat("en-us", { useGrouping: false, minimumFractionDigits: 4, maximumFractionDigits: 8, style: 'percent'}); | ||
| 15 | + | ||
| 16 | + assertEquals("12345.6789%", nf.format(123.456789)); | ||
| 17 | + assertEquals("12345.678912%", nf.format(123.45678912)); | ||
| 18 | + assertEquals("12345.6700%", nf.format(123.4567)); | ||
| 19 | + assertEquals("12345.67891234%", nf.format(123.456789123421)); | ||
| 20 | + | ||
| 21 | + nf = new Intl.NumberFormat('en', {minimumFractionDigits: 4, maximumFractionDigits: 8, style: 'currency', currency: 'USD'}); | ||
| 22 | + | ||
| 23 | + assertEquals("$54,306.404797", nf.format(54306.4047970)); | ||
| 24 | + assertEquals("$54,306.4000", nf.format(54306.4)); | ||
| 25 | + assertEquals("$54,306.40000001", nf.format(54306.400000011)); | ||
| 26 | + | ||
| 27 | + // Ensure that appropriate defaults exist when minimum and maximum are not specified | ||
| 28 | + | ||
| 29 | + nf = new Intl.NumberFormat("en-us", { useGrouping: false }); | ||
| 30 | + | ||
| 31 | + assertEquals("12345.679", nf.format(12345.6789)); | ||
| 32 | + assertEquals("12345.679", nf.format(12345.678912)); | ||
| 33 | + assertEquals("12345.67", nf.format(12345.6700)); | ||
| 34 | + assertEquals("12345", nf.format(12345)); | ||
| 35 | + assertEquals("12345.679", nf.format(12345.6789123421)); | ||
| 36 | + | ||
| 37 | + nf = new Intl.NumberFormat("en-us", { useGrouping: false, style: 'percent'}); | ||
| 38 | + | ||
| 39 | + assertEquals("12346%", nf.format(123.456789)); | ||
| 40 | + assertEquals("12346%", nf.format(123.45678912)); | ||
| 41 | + assertEquals("12346%", nf.format(123.456700)); | ||
| 42 | + assertEquals("12346%", nf.format(123.456789123421)); | ||
| 43 | + assertEquals("12345%", nf.format(123.45)); | ||
| 44 | + | ||
| 45 | + // For currency, the minimum or the maximum can be overwritten individually | ||
| 46 | + | ||
| 47 | + nf = new Intl.NumberFormat('en', {minimumFractionDigits: 0, style: 'currency', currency: 'USD'}); | ||
| 48 | + | ||
| 49 | + assertEquals("$54,306.4", nf.format(54306.4047970)); | ||
| 50 | + assertEquals("$54,306.4", nf.format(54306.4)); | ||
| 51 | + assertEquals("$54,306", nf.format(54306)); | ||
| 52 | + | ||
| 53 | + nf = new Intl.NumberFormat('en', {maximumFractionDigits: 3, style: 'currency', currency: 'USD'}); | ||
| 54 | + | ||
| 55 | + assertEquals("$54,306.405", nf.format(54306.4047970)); | ||
| 56 | + assertEquals("$54,306.40", nf.format(54306.4)); | ||
| 57 | + assertEquals("$54,306.00", nf.format(54306)); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,34 @@ | |||
| 1 | + // Copyright 2015 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + // Flags: --allow-natives-syntax | ||
| 6 | + | ||
| 7 | + "use strict"; | ||
| 8 | + | ||
| 9 | + function Message(message) { | ||
| 10 | + this.message = message; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + function Inlined(input) { | ||
| 14 | + var dummy = arguments[1] === undefined; | ||
| 15 | + if (input instanceof Message) { | ||
| 16 | + return input; | ||
| 17 | + } | ||
| 18 | + print("unreachable, but we must create register allocation complexity"); | ||
| 19 | + return []; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + function Process(input) { | ||
| 23 | + var ret = []; | ||
| 24 | + ret.push(Inlined(input[0], 1, 2)); | ||
| 25 | + return ret; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + var input = [new Message("TEST PASS")]; | ||
| 29 | + | ||
| 30 | + Process(input); | ||
| 31 | + Process(input); | ||
| 32 | + %OptimizeFunctionOnNextCall(Process); | ||
| 33 | + var result = Process(input); | ||
| 34 | + assertEquals("TEST PASS", result[0].message); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments