src/host.js

Maintainability

100.00

Lines of code

64

Created with Raphaël 2.1.002550751002019-3-122018-12-32018-8-22018-5-92018-4-32018-2-282017-12-212017-11-12017-6-7

2019-10-30
Maintainability: 100

Created with Raphaël 2.1.0017.53552.5702019-3-122018-12-32018-8-22018-5-92018-4-32018-2-282017-12-212017-11-12017-6-7

2019-10-30
Lines of Code: 64

Difficulty

4.00

Estimated Errors

0.08

Function weight

By Complexity

Created with Raphaël 2.1.0<anonymous>1

By SLOC

Created with Raphaël 2.1.0<anonymous>3
1
/**
2
 * @file Triggers host specific boot
3
 * @since 0.2.1
4
 */
5
/*#ifndef(UMD)*/
6
"use strict";
7
/*global _GPF_HOST*/ // Host types
8
/*global _gpfHost*/ // Host type
9
/*#endif*/
10
 
11
/**
12
 * Host type enumeration
13
 *
14
 * @enum {String}
15
 * @readonly
16
 * @since 0.1.5
17
 */
18
gpf.hosts = {
19
    /**
20
     * Any browser (phantomjs is recognized separately)
21
     * @since 0.1.5
22
     */
23
    browser: _GPF_HOST.BROWSER,
24
    /**
25
     * [Nashorn](https://en.wikipedia.org/wiki/Nashorn_%28JavaScript_engine%29)
26
     * @since 0.2.4
27
     */
28
    nashorn: _GPF_HOST.NASHORN,
29
    /**
30
     * [NodeJs](http://nodejs.org/)
31
     * @since 0.1.5
32
     */
33
    nodejs: _GPF_HOST.NODEJS,
34
    /**
35
     * [PhantomJS](http://phantomjs.org/)
36
     * @since 0.1.5
37
     */
38
    phantomjs: _GPF_HOST.PHANTOMJS,
39
    /**
40
     * [Rhino](http://developer.mozilla.org/en/docs/Rhino)
41
     * @since 0.1.5
42
     */
43
    rhino: _GPF_HOST.RHINO,
44
    /**
45
     * Unknown (detection failed or the host is unknown)
46
     * @since 0.1.5
47
     */
48
    unknown: _GPF_HOST.UNKNOWN,
49
    /**
50
     * [cscript/wscript](http://technet.microsoft.com/en-us/library/bb490887.aspx)
51
     * @since 0.1.5
52
     */
53
    wscript: _GPF_HOST.WSCRIPT
54
};
55
 
56
/**
57
 * Returns the detected host type
58
 *
59
 * @return {gpf.hosts} Host type
60
 * @since 0.1.5
61
 */
62
gpf.host = function () {
63
    return _gpfHost;
64
};