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

Side by Side Diff: src/v8natives.js

Issue 5781002: Ensure that default value is explicitly initialized in DefineOwnProperty. (Closed)
Patch Set: 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 | no next file » | 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 var value; // Default value is undefined. 618 var value = void 0; // Default value is undefined.
619 if (desc.hasValue()) { 619 if (desc.hasValue()) {
620 value = desc.getValue(); 620 value = desc.getValue();
621 } else if (!IS_UNDEFINED(current)) { 621 } else if (!IS_UNDEFINED(current)) {
622 value = current.getValue(); 622 value = current.getValue();
623 } 623 }
624 %DefineOrRedefineDataProperty(obj, p, value, flag); 624 %DefineOrRedefineDataProperty(obj, p, value, flag);
625 } else { 625 } else {
626 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) { 626 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) {
627 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag); 627 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag);
628 } 628 }
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 // ---------------------------------------------------------------------------- 1193 // ----------------------------------------------------------------------------
1194 1194
1195 function SetupFunction() { 1195 function SetupFunction() {
1196 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1196 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1197 "bind", FunctionBind, 1197 "bind", FunctionBind,
1198 "toString", FunctionToString 1198 "toString", FunctionToString
1199 )); 1199 ));
1200 } 1200 }
1201 1201
1202 SetupFunction(); 1202 SetupFunction();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698