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

Side by Side Diff: test/mjsunit/accessors-no-prototype.js

Issue 883073008: Accessor functions should have no prototype property (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use bitshift Created 5 years, 10 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
« no previous file with comments | « src/x87/full-codegen-x87.cc ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 (function TestGetter() {
7 var o = {
8 get x() {}
9 };
10 var desc = Object.getOwnPropertyDescriptor(o, 'x');
11 assertEquals('function', typeof desc.get);
12 assertFalse('prototype' in desc.get);
13
14 assertThrows(function() {
15 new desc.get();
16 }, TypeError);
17 })();
18
19
20 (function TestSetter() {
21 var o = {
22 set x(_) {}
23 };
24 var desc = Object.getOwnPropertyDescriptor(o, 'x');
25 assertEquals('function', typeof desc.set);
26 assertFalse('prototype' in desc.set);
27
28 assertThrows(function() {
29 new desc.set();
30 }, TypeError);
31 })();
32
33
34 (function TestBoth() {
35 var o = {
36 get x() {},
37 set x(_) {}
38 };
39 var desc = Object.getOwnPropertyDescriptor(o, 'x');
40 assertEquals('function', typeof desc.get);
41 assertEquals('function', typeof desc.set);
42 assertFalse('prototype' in desc.get);
43 assertFalse('prototype' in desc.set);
44
45 assertThrows(function() {
46 new desc.get();
47 }, TypeError);
48 assertThrows(function() {
49 new desc.set();
50 }, TypeError);
51 })();
OLDNEW
« no previous file with comments | « src/x87/full-codegen-x87.cc ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698