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

Side by Side Diff: test/mjsunit/proto-accessor.js

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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/mjsunit.status ('k') | test/mjsunit/regress-keyed-store-non-strict-arguments.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 assertThrows(function() { getProto.call(null); }, TypeError); 95 assertThrows(function() { getProto.call(null); }, TypeError);
96 assertThrows(function() { getProto.call(undefined); }, TypeError); 96 assertThrows(function() { getProto.call(undefined); }, TypeError);
97 } 97 }
98 TestGetProtoOfValues(); 98 TestGetProtoOfValues();
99 99
100 100
101 var values = [1, true, false, 's', Symbol()]; 101 var values = [1, true, false, 's', Symbol()];
102 102
103 103
104 function TestSetProtoOfValues() { 104 function TestSetProtoOfValues() {
105 var proto = {};
105 for (var i = 0; i < values.length; i++) { 106 for (var i = 0; i < values.length; i++) {
106 assertEquals(setProto.call(values[i], i), undefined); 107 assertEquals(setProto.call(values[i], proto), undefined);
107 } 108 }
108 109
109 assertThrows(function() { setProto.call(null, 7); }, TypeError); 110 assertThrows(function() { setProto.call(null, proto); }, TypeError);
110 assertThrows(function() { setProto.call(undefined, 8); }, TypeError); 111 assertThrows(function() { setProto.call(undefined, proto); }, TypeError);
111 } 112 }
112 TestSetProtoOfValues(); 113 TestSetProtoOfValues();
113 114
114 115
115 function TestSetProtoToValue() { 116 function TestSetProtoToValue() {
116 var object = {}; 117 var object = {};
117 var proto = {}; 118 var proto = {};
118 setProto.call(object, proto); 119 setProto.call(object, proto);
119 120
120 var valuesWithUndefined = values.concat(undefined); 121 var valuesWithUndefined = values.concat(undefined);
(...skipping 16 matching lines...) Expand all
137 var p = {}; 138 var p = {};
138 o.__proto__ = p; 139 o.__proto__ = p;
139 assertEquals(Object.getPrototypeOf(o), Object.prototype); 140 assertEquals(Object.getPrototypeOf(o), Object.prototype);
140 var desc4 = Object.getOwnPropertyDescriptor(o, "__proto__"); 141 var desc4 = Object.getOwnPropertyDescriptor(o, "__proto__");
141 assertTrue(desc4.configurable); 142 assertTrue(desc4.configurable);
142 assertTrue(desc4.enumerable); 143 assertTrue(desc4.enumerable);
143 assertTrue(desc4.writable); 144 assertTrue(desc4.writable);
144 assertEquals(desc4.value, p); 145 assertEquals(desc4.value, p);
145 } 146 }
146 TestDeleteProto(); 147 TestDeleteProto();
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/regress-keyed-store-non-strict-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698