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

Unified Diff: test/mjsunit/strong/implicit-conversions-constants.js

Issue 1216463003: [strong] Implement strong mode semantics for the count operation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback + eliminate runtime check Created 5 years, 6 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/mjsunit/strong/implicit-conversions.js ('k') | test/mjsunit/strong/implicit-conversions-count.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/implicit-conversions-constants.js
diff --git a/test/mjsunit/strong/implicit-conversions-constants.js b/test/mjsunit/strong/implicit-conversions-constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..c24056299ff8d80fb55bf24b5906433c8461c581
--- /dev/null
+++ b/test/mjsunit/strong/implicit-conversions-constants.js
@@ -0,0 +1,203 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --strong-mode --allow-natives-syntax
+
+"use strict";
+
+function getTestFuncs() {
+ "use strong";
+ return [
+ function(x){return 1 + true;},
+ function(x){return 1 - true;},
+ function(x){return 1 * true;},
+ function(x){return 1 / true;},
+ function(x){return 1 % true;},
+ function(x){return 1 | true;},
+ function(x){return 1 & true;},
+ function(x){return 1 ^ true;},
+ function(x){return 1 << true;},
+ function(x){return 1 >> true;},
+ function(x){return 1 >>> true;},
+ function(x){return 1 < true;},
+ function(x){return 1 > true;},
+ function(x){return 1 <= true;},
+ function(x){return 1 >= true;},
+ function(x){return 1 + undefined;},
+ function(x){return 1 - undefined;},
+ function(x){return 1 * undefined;},
+ function(x){return 1 / undefined;},
+ function(x){return 1 % undefined;},
+ function(x){return 1 | undefined;},
+ function(x){return 1 & undefined;},
+ function(x){return 1 ^ undefined;},
+ function(x){return 1 << undefined;},
+ function(x){return 1 >> undefined;},
+ function(x){return 1 >>> undefined;},
+ function(x){return 1 < undefined;},
+ function(x){return 1 > undefined;},
+ function(x){return 1 <= undefined;},
+ function(x){return 1 >= undefined;},
+ function(x){return 1 + null;},
+ function(x){return 1 - null;},
+ function(x){return 1 * null;},
+ function(x){return 1 / null;},
+ function(x){return 1 % null;},
+ function(x){return 1 | null;},
+ function(x){return 1 & null;},
+ function(x){return 1 ^ null;},
+ function(x){return 1 << null;},
+ function(x){return 1 >> null;},
+ function(x){return 1 >>> null;},
+ function(x){return 1 < null;},
+ function(x){return 1 > null;},
+ function(x){return 1 <= null;},
+ function(x){return 1 >= null;},
+ function(x){return NaN + true;},
+ function(x){return NaN - true;},
+ function(x){return NaN * true;},
+ function(x){return NaN / true;},
+ function(x){return NaN % true;},
+ function(x){return NaN | true;},
+ function(x){return NaN & true;},
+ function(x){return NaN ^ true;},
+ function(x){return NaN << true;},
+ function(x){return NaN >> true;},
+ function(x){return NaN >>> true;},
+ function(x){return NaN < true;},
+ function(x){return NaN > true;},
+ function(x){return NaN <= true;},
+ function(x){return NaN >= true;},
+ function(x){return NaN + undefined;},
+ function(x){return NaN - undefined;},
+ function(x){return NaN * undefined;},
+ function(x){return NaN / undefined;},
+ function(x){return NaN % undefined;},
+ function(x){return NaN | undefined;},
+ function(x){return NaN & undefined;},
+ function(x){return NaN ^ undefined;},
+ function(x){return NaN << undefined;},
+ function(x){return NaN >> undefined;},
+ function(x){return NaN >>> undefined;},
+ function(x){return NaN < undefined;},
+ function(x){return NaN > undefined;},
+ function(x){return NaN <= undefined;},
+ function(x){return NaN >= undefined;},
+ function(x){return NaN + null;},
+ function(x){return NaN - null;},
+ function(x){return NaN * null;},
+ function(x){return NaN / null;},
+ function(x){return NaN % null;},
+ function(x){return NaN | null;},
+ function(x){return NaN & null;},
+ function(x){return NaN ^ null;},
+ function(x){return NaN << null;},
+ function(x){return NaN >> null;},
+ function(x){return NaN >>> null;},
+ function(x){return NaN < null;},
+ function(x){return NaN > null;},
+ function(x){return NaN <= null;},
+ function(x){return NaN >= null;},
+ function(x){return true + 1;},
+ function(x){return true - 1;},
+ function(x){return true * 1;},
+ function(x){return true / 1;},
+ function(x){return true % 1;},
+ function(x){return true | 1;},
+ function(x){return true & 1;},
+ function(x){return true ^ 1;},
+ function(x){return true << 1;},
+ function(x){return true >> 1;},
+ function(x){return true >>> 1;},
+ function(x){return true < 1;},
+ function(x){return true > 1;},
+ function(x){return true <= 1;},
+ function(x){return true >= 1;},
+ function(x){return undefined + 1;},
+ function(x){return undefined - 1;},
+ function(x){return undefined * 1;},
+ function(x){return undefined / 1;},
+ function(x){return undefined % 1;},
+ function(x){return undefined | 1;},
+ function(x){return undefined & 1;},
+ function(x){return undefined ^ 1;},
+ function(x){return undefined << 1;},
+ function(x){return undefined >> 1;},
+ function(x){return undefined >>> 1;},
+ function(x){return undefined < 1;},
+ function(x){return undefined > 1;},
+ function(x){return undefined <= 1;},
+ function(x){return undefined >= 1;},
+ function(x){return null + 1;},
+ function(x){return null - 1;},
+ function(x){return null * 1;},
+ function(x){return null / 1;},
+ function(x){return null % 1;},
+ function(x){return null | 1;},
+ function(x){return null & 1;},
+ function(x){return null ^ 1;},
+ function(x){return null << 1;},
+ function(x){return null >> 1;},
+ function(x){return null >>> 1;},
+ function(x){return null < 1;},
+ function(x){return null > 1;},
+ function(x){return null <= 1;},
+ function(x){return null >= 1;},
+ function(x){return true + NaN;},
+ function(x){return true - NaN;},
+ function(x){return true * NaN;},
+ function(x){return true / NaN;},
+ function(x){return true % NaN;},
+ function(x){return true | NaN;},
+ function(x){return true & NaN;},
+ function(x){return true ^ NaN;},
+ function(x){return true << NaN;},
+ function(x){return true >> NaN;},
+ function(x){return true >>> NaN;},
+ function(x){return true < NaN;},
+ function(x){return true > NaN;},
+ function(x){return true <= NaN;},
+ function(x){return true >= NaN;},
+ function(x){return undefined + NaN;},
+ function(x){return undefined - NaN;},
+ function(x){return undefined * NaN;},
+ function(x){return undefined / NaN;},
+ function(x){return undefined % NaN;},
+ function(x){return undefined | NaN;},
+ function(x){return undefined & NaN;},
+ function(x){return undefined ^ NaN;},
+ function(x){return undefined << NaN;},
+ function(x){return undefined >> NaN;},
+ function(x){return undefined >>> NaN;},
+ function(x){return undefined < NaN;},
+ function(x){return undefined > NaN;},
+ function(x){return undefined <= NaN;},
+ function(x){return undefined >= NaN;},
+ function(x){return null + NaN;},
+ function(x){return null - NaN;},
+ function(x){return null * NaN;},
+ function(x){return null / NaN;},
+ function(x){return null % NaN;},
+ function(x){return null | NaN;},
+ function(x){return null & NaN;},
+ function(x){return null ^ NaN;},
+ function(x){return null << NaN;},
+ function(x){return null >> NaN;},
+ function(x){return null >>> NaN;},
+ function(x){return null < NaN;},
+ function(x){return null > NaN;},
+ function(x){return null <= NaN;},
+ function(x){return null >= NaN;}
+ ];
+}
+
+for (let func of getTestFuncs()) {
+ assertThrows(func, TypeError);
+ assertThrows(func, TypeError);
+ assertThrows(func, TypeError);
+ %OptimizeFunctionOnNextCall(func);
+ assertThrows(func, TypeError);
+ %DeoptimizeFunction(func);
+ assertThrows(func, TypeError);
+}
« no previous file with comments | « test/mjsunit/strong/implicit-conversions.js ('k') | test/mjsunit/strong/implicit-conversions-count.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698