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

Side by Side Diff: test/preparser/duplicate-property.pyt

Issue 352173004: Relax object literal checking to follow ES6 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/strict-mode.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2011 the V8 project authors. All rights reserved. 1 # Copyright 2011, 2014 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
11 # with the distribution. 11 # with the distribution.
(...skipping 27 matching lines...) Expand all
39 if (allow_strict): 39 if (allow_strict):
40 Template("strict-" + name, 40 Template("strict-" + name,
41 "\"use strict\";\n" + source)(replacement, expectation) 41 "\"use strict\";\n" + source)(replacement, expectation)
42 Template(name, source)(replacement, expectation) 42 Template(name, source)(replacement, expectation)
43 43
44 # This one only fails in non-strict context. 44 # This one only fails in non-strict context.
45 if (allow_strict): 45 if (allow_strict):
46 Template("strict-$name-data-data", """ 46 Template("strict-$name-data-data", """
47 "use strict"; 47 "use strict";
48 var o = {$id1: 42, $id2: 42}; 48 var o = {$id1: 42, $id2: 42};
49 """)(replacement, "strict_duplicate_property") 49 """)(replacement, None)
50 50
51 Template("$name-data-data", """ 51 Template("$name-data-data", """
52 var o = {$id1: 42, $id2: 42}; 52 var o = {$id1: 42, $id2: 42};
53 """)(replacement, None) 53 """)(replacement, None)
54 54
55 StrictTest("$name-data-get", """ 55 StrictTest("$name-data-get", """
56 var o = {$id1: 42, get $id2(){}}; 56 var o = {$id1: 42, get $id2(){}};
57 """, replacement, "accessor_data_property") 57 """, replacement, None)
58 58
59 StrictTest("$name-data-set", """ 59 StrictTest("$name-data-set", """
60 var o = {$id1: 42, set $id2(v){}}; 60 var o = {$id1: 42, set $id2(v){}};
61 """, replacement, "accessor_data_property") 61 """, replacement, None)
62 62
63 StrictTest("$name-get-data", """ 63 StrictTest("$name-get-data", """
64 var o = {get $id1(){}, $id2: 42}; 64 var o = {get $id1(){}, $id2: 42};
65 """, replacement, "accessor_data_property") 65 """, replacement, None)
66 66
67 StrictTest("$name-set-data", """ 67 StrictTest("$name-set-data", """
68 var o = {set $id1(v){}, $id2: 42}; 68 var o = {set $id1(v){}, $id2: 42};
69 """, replacement, "accessor_data_property") 69 """, replacement, None)
70 70
71 StrictTest("$name-get-get", """ 71 StrictTest("$name-get-get", """
72 var o = {get $id1(){}, get $id2(){}}; 72 var o = {get $id1(){}, get $id2(){}};
73 """, replacement, "accessor_get_set") 73 """, replacement, None)
74 74
75 StrictTest("$name-set-set", """ 75 StrictTest("$name-set-set", """
76 var o = {set $id1(v){}, set $id2(v){}}; 76 var o = {set $id1(v){}, set $id2(v){}};
77 """, replacement, "accessor_get_set") 77 """, replacement, None)
78 78
79 StrictTest("$name-nested-get", """ 79 StrictTest("$name-nested-get", """
80 var o = {get $id1(){}, o: {get $id2(){} } }; 80 var o = {get $id1(){}, o: {get $id2(){} } };
81 """, replacement, None) 81 """, replacement, None)
82 82
83 StrictTest("$name-nested-set", """ 83 StrictTest("$name-nested-set", """
84 var o = {set $id1(v){}, o: {set $id2(v){} } }; 84 var o = {set $id1(v){}, o: {set $id2(v){} } };
85 """, replacement, None) 85 """, replacement, None)
86 86
87 87
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 TestBothWays("rounding-down", "1.12512512512512452", "1.1251251251251244") 153 TestBothWays("rounding-down", "1.12512512512512452", "1.1251251251251244")
154 TestBothWays("rounding-up", "1.12512512512512453", "1.1251251251251246") 154 TestBothWays("rounding-up", "1.12512512512512453", "1.1251251251251246")
155 155
156 TestBothWays("hex-int-str", "0x20", '"32"') 156 TestBothWays("hex-int-str", "0x20", '"32"')
157 TestBothWays("dec-int-str", "32.00", '"32"') 157 TestBothWays("dec-int-str", "32.00", '"32"')
158 TestBothWays("exp-int-str", "3.2e1", '"32"') 158 TestBothWays("exp-int-str", "3.2e1", '"32"')
159 TestBothWays("overflow-inf-str", "1e2000", '"Infinity"') 159 TestBothWays("overflow-inf-str", "1e2000", '"Infinity"')
160 TestBothWays("underflow-0-str", "1e-2000", '"0"') 160 TestBothWays("underflow-0-str", "1e-2000", '"0"')
161 TestBothWays("non-canonical-literal-int-str", "1.0", '"1"') 161 TestBothWays("non-canonical-literal-int-str", "1.0", '"1"')
162 TestBothWays("non-canonical-literal-frac-str", "1.50", '"1.5"') 162 TestBothWays("non-canonical-literal-frac-str", "1.50", '"1.5"')
OLDNEW
« no previous file with comments | « test/mjsunit/strict-mode.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698