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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/get-interface-names.js

Issue 2627023002: Introduce Origin-Trial for Service Worker Navigation Preload (Closed)
Patch Set: s/an/a Created 3 years, 11 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
(Empty)
1 function get_interface_names(global_object, interface_names) {
2 var result = [];
3 function collect_property_info(object, property_name, output) {
4 var descriptor = Object.getOwnPropertyDescriptor(object, property_name);
5 if ('value' in descriptor) {
6 if (typeof descriptor.value === 'function') {
7 output.push(' method ' + property_name);
8 } else {
9 output.push(' attribute ' + property_name);
10 }
11 } else {
12 if (descriptor.get) {
13 output.push(' getter ' + property_name);
14 }
15 if (descriptor.set) {
16 output.push(' setter ' + property_name);
17 }
18 }
19 }
20 interface_names.sort();
21 interface_names.forEach(function(interface_name) {
22 if (this[interface_name] === undefined) {
23 return;
24 }
25 result.push('interface ' + interface_name);
26 var property_names =
27 Object.getOwnPropertyNames(this[interface_name].prototype);
28 var property_strings = [];
29 property_names.forEach(function(property_name) {
30 collect_property_info(this[interface_name].prototype,
31 property_name,
32 property_strings);
33 });
34 result.push.apply(result, property_strings.sort());
35 });
36 return result.join("\n");;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698