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

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

Issue 2431223005: Implement DefineOwnProperty for TypedArrays (Closed)
Patch Set: formatting fixes Created 4 years 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
« no previous file with comments | « src/objects.cc ('k') | test/test262/test262.status » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 (function () { 7 (function () {
8 var o = []; 8 var o = [];
9 o.__proto__ = {}; 9 o.__proto__ = {};
10 10
(...skipping 11 matching lines...) Expand all
22 Object.defineProperty(o, "3", { 22 Object.defineProperty(o, "3", {
23 get:function() { return 100; }, 23 get:function() { return 100; },
24 set:function(v) { set = v; }}); 24 set:function(v) { set = v; }});
25 25
26 store(o, 3, 1000); 26 store(o, 3, 1000);
27 assertEquals(1000, set); 27 assertEquals(1000, set);
28 assertEquals(100, o[3]); 28 assertEquals(100, o[3]);
29 })(); 29 })();
30 30
31 (function () { 31 (function () {
32 var o = new Int32Array(); 32 var o = new Int32Array(1);
33 Object.defineProperty(o, "0", {get: function(){}}); 33 assertThrows(
34 assertEquals(undefined, Object.getOwnPropertyDescriptor(o, "0")); 34 () => Object.defineProperty(o, '0', {get: function() {}}), TypeError);
Dan Ehrenberg 2016/11/28 23:01:40 Looks like this case started to throw when it prev
caitp 2016/11/28 23:10:10 Defining accessors on typed arrays used to fail si
Dan Ehrenberg 2016/11/28 23:13:13 OK, if we're not the first to ship this fix, I'm f
35 assertEquals({
36 value: 0,
37 writable: true,
38 enumerable: true,
39 configurable: false
40 }, Object.getOwnPropertyDescriptor(o, "0"));
35 })(); 41 })();
36 42
37 (function() { 43 (function() {
38 function f() { 44 function f() {
39 var a = new Array(); 45 var a = new Array();
40 a[1] = 1.5; 46 a[1] = 1.5;
41 return a; 47 return a;
42 } 48 }
43 49
44 f(); 50 f();
45 f(); 51 f();
46 %OptimizeFunctionOnNextCall(f); 52 %OptimizeFunctionOnNextCall(f);
47 var a = f(); 53 var a = f();
48 a[2] = 2; 54 a[2] = 2;
49 assertEquals(3, a.length); 55 assertEquals(3, a.length);
50 })(); 56 })();
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698