blob: ef7aa32f73646c47bec8b51694b458ad50d929a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
if (mojo && mojo.internal) {
throw new Error('The Mojo bindings library has been initialized.');
}
var mojo = mojo || {};
mojo.internal = {};
mojo.internal.global = this;
(function() {
var internal = mojo.internal;
function exposeNamespace(namespace) {
var current = internal.global;
var parts = namespace.split('.');
for (var part; parts.length && (part = parts.shift());) {
if (!current[part]) {
current[part] = {};
}
current = current[part];
}
return current;
}
internal.exposeNamespace = exposeNamespace;
})();
|