Chromium Code Reviews| Index: extensions/renderer/argument_spec.cc |
| diff --git a/extensions/renderer/argument_spec.cc b/extensions/renderer/argument_spec.cc |
| index 08768595b80ddb9dbb27efc8bf4eaa1b42138af0..9bdefdb4c7ef79208f0cdc36a3fc8c4c29f84c07 100644 |
| --- a/extensions/renderer/argument_spec.cc |
| +++ b/extensions/renderer/argument_spec.cc |
| @@ -420,8 +420,16 @@ bool ArgumentSpec::ParseArgumentToObject( |
| // HasOwnProperty() check here in the future, if we desire. |
| // See also comment in ParseArgumentToArray() about passing in custom |
| // crazy values here. |
| - if (!object->Get(context, key).ToLocal(&prop_value)) |
| + if (!object->Get(context, key).ToLocal(&prop_value)) { |
| + // Technically, in the case of the property being removed before access, |
|
jbroman
2017/04/27 19:37:20
Hmm? Getting a nonexistent property will successfu
Devlin
2017/05/01 22:22:09
Ah, good point. Comment removed.
|
| + // this error message will be wrong. But since that can only happen if |
| + // someone removes a property after the initial GetOwnPropertyNames() |
| + // check, this seems reasonable enough - these error messages are meant |
| + // to be helpful, but don't need 100% accuracy in deliberately-crazy |
| + // cases. |
| + *error = api_errors::ScriptThrewError(); |
| return false; |
| + } |
| // Note: We don't serialize undefined or null values. |
| // TODO(devlin): This matches current behavior, but it is correct? |