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

Unified Diff: extensions/renderer/resources/binding.js

Issue 1055673002: [Extensions API] Remove inline enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/api/web_view_internal.json ('k') | extensions/renderer/safe_builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/binding.js
diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js
index 22ccb7bdc212aa69000fa5d63b5a9d1462b66b56..7d418866249b9bb366c5b1df2aa8055e68b55fba 100644
--- a/extensions/renderer/resources/binding.js
+++ b/extensions/renderer/resources/binding.js
@@ -289,17 +289,17 @@ Binding.prototype = {
if (enumValues) {
// Type IDs are qualified with the namespace during compilation,
// unfortunately, so remove it here.
- logging.DCHECK(
- t.id.substr(0, schema.namespace.length) == schema.namespace);
+ logging.DCHECK($String.substr(t.id, 0, schema.namespace.length) ==
+ schema.namespace);
// Note: + 1 because it ends in a '.', e.g., 'fooApi.Type'.
- var id = t.id.substr(schema.namespace.length + 1);
+ var id = $String.substr(t.id, schema.namespace.length + 1);
mod[id] = {};
$Array.forEach(enumValues, function(enumValue) {
// Note: enums can be declared either as a list of strings
// ['foo', 'bar'] or as a list of objects
// [{'name': 'foo'}, {'name': 'bar'}].
- enumValue =
- enumValue.hasOwnProperty('name') ? enumValue.name : enumValue;
+ enumValue = $Object.hasOwnProperty(enumValue, 'name') ?
+ enumValue.name : enumValue;
if (enumValue) // Avoid setting any empty enums.
mod[id][enumValue] = enumValue;
});
« no previous file with comments | « extensions/common/api/web_view_internal.json ('k') | extensions/renderer/safe_builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698