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

Side by Side Diff: src/v8natives.js

Issue 103853006: ES6: Tighten up Object.prototype.__proto__ (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: __proto__ setter should return undefined Created 6 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 | « no previous file | test/mjsunit/proto-accessor.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 // Harmony egal. 1377 // Harmony egal.
1378 function ObjectIs(obj1, obj2) { 1378 function ObjectIs(obj1, obj2) {
1379 if (obj1 === obj2) { 1379 if (obj1 === obj2) {
1380 return (obj1 !== 0) || (1 / obj1 === 1 / obj2); 1380 return (obj1 !== 0) || (1 / obj1 === 1 / obj2);
1381 } else { 1381 } else {
1382 return (obj1 !== obj1) && (obj2 !== obj2); 1382 return (obj1 !== obj1) && (obj2 !== obj2);
1383 } 1383 }
1384 } 1384 }
1385 1385
1386 1386
1387 // Harmony __proto__ getter. 1387 // ECMA-262, Edition 6, section B.2.2.1.1
1388 function ObjectGetProto() { 1388 function ObjectGetProto() {
1389 return %GetPrototype(this); 1389 return %GetPrototype(ToObject(this));
1390 } 1390 }
1391 1391
1392 1392
1393 // Harmony __proto__ setter. 1393 // ECMA-262, Edition 6, section B.2.2.1.2
1394 function ObjectSetProto(obj) { 1394 function ObjectSetProto(proto) {
1395 return %SetPrototype(this, obj); 1395 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.__proto__");
1396
1397 if (IS_SPEC_OBJECT(proto) || IS_NULL(proto) && IS_SPEC_OBJECT(this)) {
1398 %SetPrototype(this, proto);
1399 }
1396 } 1400 }
1397 1401
1398 1402
1399 function ObjectConstructor(x) { 1403 function ObjectConstructor(x) {
1400 if (%_IsConstructCall()) { 1404 if (%_IsConstructCall()) {
1401 if (x == null) return this; 1405 if (x == null) return this;
1402 return ToObject(x); 1406 return ToObject(x);
1403 } else { 1407 } else {
1404 if (x == null) return { }; 1408 if (x == null) return { };
1405 return ToObject(x); 1409 return ToObject(x);
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 function RunMicrotasks() { 1898 function RunMicrotasks() {
1895 while (%SetMicrotaskPending(false)) { 1899 while (%SetMicrotaskPending(false)) {
1896 var microtasks = RunMicrotasks.queue; 1900 var microtasks = RunMicrotasks.queue;
1897 RunMicrotasks.queue = new InternalArray; 1901 RunMicrotasks.queue = new InternalArray;
1898 1902
1899 for (var i = 0; i < microtasks.length; i++) { 1903 for (var i = 0; i < microtasks.length; i++) {
1900 microtasks[i](); 1904 microtasks[i]();
1901 } 1905 }
1902 } 1906 }
1903 } 1907 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/proto-accessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698