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

Side by Side Diff: test/mjsunit/builtins.js

Issue 12212011: Make __proto__ a foreign callback on Object.prototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added regression test for issue 2441. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/harmony/object-observe.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (propNames.length == 0 || 47 if (propNames.length == 0 ||
48 (propNames.length == 1 && propNames[0] == "constructor")) { 48 (propNames.length == 1 && propNames[0] == "constructor")) {
49 // Not a constructor. 49 // Not a constructor.
50 return; 50 return;
51 } 51 }
52 var proto_desc = Object.getOwnPropertyDescriptor(func, "prototype"); 52 var proto_desc = Object.getOwnPropertyDescriptor(func, "prototype");
53 assertTrue(proto_desc.hasOwnProperty("value"), name); 53 assertTrue(proto_desc.hasOwnProperty("value"), name);
54 assertFalse(proto_desc.writable, name); 54 assertFalse(proto_desc.writable, name);
55 assertFalse(proto_desc.configurable, name); 55 assertFalse(proto_desc.configurable, name);
56 var prototype = proto_desc.value; 56 var prototype = proto_desc.value;
57 assertEquals(null, prototype.__proto__, name); 57 assertEquals(null, Object.getPrototypeOf(prototype), name);
58 for (var i = 0; i < propNames.length; i++) { 58 for (var i = 0; i < propNames.length; i++) {
59 var propName = propNames[i]; 59 var propName = propNames[i];
60 if (propName == "constructor") continue; 60 if (propName == "constructor") continue;
61 var testName = name + "-" + propName; 61 var testName = name + "-" + propName;
62 var propDesc = Object.getOwnPropertyDescriptor(prototype, propName); 62 var propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
63 assertTrue(propDesc.hasOwnProperty("value"), testName); 63 assertTrue(propDesc.hasOwnProperty("value"), testName);
64 assertFalse(propDesc.configurable, testName); 64 assertFalse(propDesc.configurable, testName);
65 if (isFunction(propDesc.value)) { 65 if (isFunction(propDesc.value)) {
66 assertFalse(propDesc.writable, testName); 66 assertFalse(propDesc.writable, testName);
67 } 67 }
68 } 68 }
69 } 69 }
70 70
71 for (var i = 0; i < names.length; i++) { 71 for (var i = 0; i < names.length; i++) {
72 var name = names[i]; 72 var name = names[i];
73 var desc = Object.getOwnPropertyDescriptor(builtins, name); 73 var desc = Object.getOwnPropertyDescriptor(builtins, name);
74 assertTrue(desc.hasOwnProperty("value")); 74 assertTrue(desc.hasOwnProperty("value"));
75 var value = desc.value; 75 var value = desc.value;
76 if (isFunction(value)) { 76 if (isFunction(value)) {
77 checkConstructor(value, name); 77 checkConstructor(value, name);
78 } 78 }
79 } 79 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698