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

Side by Side Diff: mojo/public/js/new_bindings/base.js

Issue 2759563004: Mojo JS bindings: change module loading solution. (Closed)
Patch Set: Make sure mojo_bindings.js is packaged in build result for running layout tests. Created 3 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 unified diff | Download patch
« no previous file with comments | « mojo/public/js/BUILD.gn ('k') | mojo/public/js/new_bindings/bindings.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 if (mojo && mojo.internal) {
8 throw new Error('The Mojo bindings library has been initialized.');
9 }
10
11 var mojo = mojo || {};
12 mojo.internal = {};
13 mojo.internal.global = this;
14
15 (function() {
16 var internal = mojo.internal;
17
18 function exposeNamespace(namespace) {
19 var current = internal.global;
20 var parts = namespace.split('.');
21
22 for (var part; parts.length && (part = parts.shift());) {
23 if (!current[part]) {
24 current[part] = {};
25 }
26 current = current[part];
27 }
28
29 return current;
30 }
31
32 internal.exposeNamespace = exposeNamespace;
33 })();
OLDNEW
« no previous file with comments | « mojo/public/js/BUILD.gn ('k') | mojo/public/js/new_bindings/bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698