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

Unified Diff: test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js

Issue 2611793002: [test] Process to locally develop and upstream test262 tests (Closed)
Patch Set: Cleanup nit Created 3 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/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js ('k') | test/test262/prune-local-tests.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js
diff --git a/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js b/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d42609acb191f674e3848d54dd8e0f4d16e3596
--- /dev/null
+++ b/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js
@@ -0,0 +1,42 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es5id: 11.1.1_1
+description: Tests that the this-value is ignored in NumberFormat.
+author: Norbert Lindenberg
+includes: [testIntl.js]
+---*/
+
+testWithIntlConstructors(function (Constructor) {
+ var obj, newObj;
+
+ if (Constructor === Intl.NumberFormat) {
+ obj = new Constructor();
+ newObj = Intl.NumberFormat.call(obj);
+ if (obj !== newObj) {
+ $ERROR("Should have modified existing object.");
+ }
+ var key = Object.getOwnPropertySymbols(newObj)[0];
+ if (!(newObj[key] instanceof Intl.NumberFormat)) {
+ $ERROR("Should have installed a NumberFormat instance.");
+ }
+ return true;
+ }
+
+ // variant 1: use constructor in a "new" expression
+ obj = new Constructor();
+ newObj = Intl.NumberFormat.call(obj);
+ if (obj === newObj) {
+ $ERROR("NumberFormat object created with \"new\" was not ignored as this-value.");
+ }
+
+ // variant 2: use constructor as a function
+ obj = Constructor();
+ newObj = Intl.NumberFormat.call(obj);
+ if (obj === newObj) {
+ $ERROR("NumberFormat object created with constructor as function was not ignored as this-value.");
+ }
+
+ return true;
+});
« no previous file with comments | « test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js ('k') | test/test262/prune-local-tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698