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

Side by Side Diff: src/v8natives.js

Issue 5773002: Fix issue 965. (Closed)
Patch Set: Address review comments Created 10 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 | « no previous file | test/mjsunit/object-define-property.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 flag |= DONT_DELETE; 608 flag |= DONT_DELETE;
609 609
610 if (IsDataDescriptor(desc) || IsGenericDescriptor(desc)) { 610 if (IsDataDescriptor(desc) || IsGenericDescriptor(desc)) {
611 if (desc.hasWritable()) { 611 if (desc.hasWritable()) {
612 flag |= desc.isWritable() ? 0 : READ_ONLY; 612 flag |= desc.isWritable() ? 0 : READ_ONLY;
613 } else if (!IS_UNDEFINED(current)) { 613 } else if (!IS_UNDEFINED(current)) {
614 flag |= current.isWritable() ? 0 : READ_ONLY; 614 flag |= current.isWritable() ? 0 : READ_ONLY;
615 } else { 615 } else {
616 flag |= READ_ONLY; 616 flag |= READ_ONLY;
617 } 617 }
618 %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag); 618 var value; // Default value is undefined.
619 if (desc.hasValue()) {
620 value = desc.getValue();
621 } else if (!IS_UNDEFINED(current)) {
622 value = current.getValue();
623 }
624 %DefineOrRedefineDataProperty(obj, p, value, flag);
619 } else { 625 } else {
620 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) { 626 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) {
621 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag); 627 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag);
622 } 628 }
623 if (desc.hasSetter() && IS_FUNCTION(desc.getSet())) { 629 if (desc.hasSetter() && IS_FUNCTION(desc.getSet())) {
624 %DefineOrRedefineAccessorProperty(obj, p, SETTER, desc.getSet(), flag); 630 %DefineOrRedefineAccessorProperty(obj, p, SETTER, desc.getSet(), flag);
625 } 631 }
626 } 632 }
627 return true; 633 return true;
628 } 634 }
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 // ---------------------------------------------------------------------------- 1193 // ----------------------------------------------------------------------------
1188 1194
1189 function SetupFunction() { 1195 function SetupFunction() {
1190 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1196 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1191 "bind", FunctionBind, 1197 "bind", FunctionBind,
1192 "toString", FunctionToString 1198 "toString", FunctionToString
1193 )); 1199 ));
1194 } 1200 }
1195 1201
1196 SetupFunction(); 1202 SetupFunction();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/object-define-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698