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

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, 6 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 if (propertyProcessed[property]) 385 if (propertyProcessed[property])
386 continue; 386 continue;
387 387
388 try { 388 try {
389 propertyProcessed[property] = true; 389 propertyProcessed[property] = true;
390 var descriptor = nullifyObjectProto(InjectedScriptHost.suppr essWarningsAndCallFunction(Object.getOwnPropertyDescriptor, Object, [o, property ])); 390 var descriptor = nullifyObjectProto(InjectedScriptHost.suppr essWarningsAndCallFunction(Object.getOwnPropertyDescriptor, Object, [o, property ]));
391 if (descriptor) { 391 if (descriptor) {
392 if (accessorPropertiesOnly && !("get" in descriptor || " set" in descriptor)) 392 if (accessorPropertiesOnly && !("get" in descriptor || " set" in descriptor))
393 continue; 393 continue;
394 if ("get" in descriptor && "set" in descriptor && name ! = "__proto__" && InjectedScriptHost.formatAccessorsAsProperties(object) && !does AttributeHaveObservableSideEffectOnGet(object, name)) { 394 if ("get" in descriptor && "set" in descriptor && name ! = "__proto__" && InjectedScriptHost.formatAccessorsAsProperties(object, descript or.get) && !doesAttributeHaveObservableSideEffectOnGet(object, name)) {
395 descriptor.value = InjectedScriptHost.suppressWarnin gsAndCallFunction(function(attribute) { return this[attribute]; }, object, [prop erty]); 395 descriptor.value = InjectedScriptHost.suppressWarnin gsAndCallFunction(function(attribute) { return this[attribute]; }, object, [prop erty]);
396 descriptor.isOwn = true; 396 descriptor.isOwn = true;
397 delete descriptor.get; 397 delete descriptor.get;
398 delete descriptor.set; 398 delete descriptor.set;
399 } 399 }
400 } else { 400 } else {
401 // Not all bindings provide proper descriptors. Fall bac k to the writable, configurable property. 401 // Not all bindings provide proper descriptors. Fall bac k to the writable, configurable property.
402 if (accessorPropertiesOnly) 402 if (accessorPropertiesOnly)
403 continue; 403 continue;
404 try { 404 try {
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf); 1001 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf);
1002 } 1002 }
1003 return string.substr(0, maxLength) + "\u2026"; 1003 return string.substr(0, maxLength) + "\u2026";
1004 }, 1004 },
1005 1005
1006 __proto__: null 1006 __proto__: null
1007 } 1007 }
1008 1008
1009 return injectedScript; 1009 return injectedScript;
1010 }) 1010 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698