File: google-closure-compiler-utils.js

package info (click to toggle)
node-knockout 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,304 kB
  • sloc: javascript: 26,455; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Google Closure Compiler helpers (used only to make the minified file smaller)
ko.exportSymbol = function(koPath, object) {
    var tokens = koPath.split(".");

    // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable)
    // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko)
    var target = ko;

    for (var i = 0; i < tokens.length - 1; i++)
        target = target[tokens[i]];
    target[tokens[tokens.length - 1]] = object;
};
ko.exportProperty = function(owner, publicName, object) {
    owner[publicName] = object;
};