In web worker world, 'self' is defined global scope object.
This change is necessary to apply tizen webapis on web worker for
specific purpose. (i.e. tizen.ml)
Change-Id: Ie9602ea4f492589dad2c87e3c0bd8e2602278c02
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
var _enableJsLogs = false;
var _global = {};
-if (typeof window != 'undefined') {
+if (typeof window !== 'undefined') {
_global = window;
-} else if (typeof global != 'undefined') {
+} else if (typeof global !== 'undefined') {
_global = global;
+} else if (typeof self !== 'undefined') {
+ _global = self;
}
/**
scope = window;
} else if (typeof global !== 'undefined') {
scope = global;
+} else if (typeof self !== 'undefined') {
+ scope = self;
}
scope = scope || {};
scope.WebAPIException = WebAPIException;