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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1950303004: [DevTools] Add additional accessor check in InjectedScriptSource.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 if (propertyProcessed[property]) 460 if (propertyProcessed[property])
461 continue; 461 continue;
462 462
463 try { 463 try {
464 propertyProcessed[property] = true; 464 propertyProcessed[property] = true;
465 var descriptor = nullifyObjectProto(InjectedScriptHost.suppr essWarningsAndCallFunction(Object.getOwnPropertyDescriptor, Object, [o, property ])); 465 var descriptor = nullifyObjectProto(InjectedScriptHost.suppr essWarningsAndCallFunction(Object.getOwnPropertyDescriptor, Object, [o, property ]));
466 if (descriptor) { 466 if (descriptor) {
467 if (accessorPropertiesOnly && !("get" in descriptor || " set" in descriptor)) 467 if (accessorPropertiesOnly && !("get" in descriptor || " set" in descriptor))
468 continue; 468 continue;
469 if ("get" in descriptor && "set" in descriptor && name ! = "__proto__" && InjectedScriptHost.formatAccessorsAsProperties(object) && !does AttributeHaveObservableSideEffectOnGet(object, name)) { 469 if ("get" in descriptor && "set" in descriptor && name ! = "__proto__" && InjectedScriptHost.formatAccessorsAsProperties(object, descript or.get) && !doesAttributeHaveObservableSideEffectOnGet(object, name)) {
470 descriptor.value = InjectedScriptHost.suppressWarnin gsAndCallFunction(function(attribute) { return this[attribute]; }, object, [prop erty]); 470 descriptor.value = InjectedScriptHost.suppressWarnin gsAndCallFunction(function(attribute) { return this[attribute]; }, object, [prop erty]);
471 descriptor.isOwn = true; 471 descriptor.isOwn = true;
472 delete descriptor.get; 472 delete descriptor.get;
473 delete descriptor.set; 473 delete descriptor.set;
474 } 474 }
475 } else { 475 } else {
476 // Not all bindings provide proper descriptors. Fall bac k to the writable, configurable property. 476 // Not all bindings provide proper descriptors. Fall bac k to the writable, configurable property.
477 if (accessorPropertiesOnly) 477 if (accessorPropertiesOnly)
478 continue; 478 continue;
479 try { 479 try {
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 /** 1300 /**
1301 * @param {!Event} event 1301 * @param {!Event} event
1302 */ 1302 */
1303 CommandLineAPIImpl._logEvent = function(event) 1303 CommandLineAPIImpl._logEvent = function(event)
1304 { 1304 {
1305 inspectedGlobalObject.console.log(event.type, event); 1305 inspectedGlobalObject.console.log(event.type, event);
1306 } 1306 }
1307 1307
1308 return injectedScript; 1308 return injectedScript;
1309 }) 1309 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698