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

Unified Diff: test/intl/number-format/format-is-bound.js

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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
« no previous file with comments | « test/intl/number-format/default-locale.js ('k') | test/intl/number-format/parse-currency.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/number-format/format-is-bound.js
diff --git a/test/mjsunit/compiler/osr-nested.js b/test/intl/number-format/format-is-bound.js
similarity index 82%
copy from test/mjsunit/compiler/osr-nested.js
copy to test/intl/number-format/format-is-bound.js
index 4bdb0828ca2272332701c579bcbf9952cf43e6a4..b24c2ed0cab91913da7ae0e1b416d521a530bcea 100644
--- a/test/mjsunit/compiler/osr-nested.js
+++ b/test/intl/number-format/format-is-bound.js
@@ -25,22 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --use-osr
+// Create default NumberFormat.
+var nf = new Intl.NumberFormat();
-function f() {
- var sum = 0;
- for (var i = 0; i < 10; i++) {
- for (var j = 0; j < 100000; j++) {
- var x = i + 2;
- var y = x + 5;
- var z = y + 3;
- sum += z;
- }
- }
- return sum;
-}
+// Array we want to iterate, actual numbers are not important.
+var numberArray = [1, 2, 3];
+// It shouldn't throw.
+// The format() method should be properly bound to the nf object.
+numberArray.forEach(nf.format);
-assertEquals(14500000, f());
-assertEquals(14500000, f());
-assertEquals(14500000, f());
+// Formatting a number should work in a direct call.
+nf.format(12345);
« no previous file with comments | « test/intl/number-format/default-locale.js ('k') | test/intl/number-format/parse-currency.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698