UNPKG

810 BJavaScriptView Raw
1/**
2 * Copyright 2013-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 */
10
11/* globals MSApp */
12
13'use strict';
14
15/**
16 * Create a function which has 'unsafe' privileges (required by windows8 apps)
17 */
18
19var createMicrosoftUnsafeLocalFunction = function (func) {
20 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
21 return function (arg0, arg1, arg2, arg3) {
22 MSApp.execUnsafeLocalFunction(function () {
23 return func(arg0, arg1, arg2, arg3);
24 });
25 };
26 } else {
27 return func;
28 }
29};
30
31module.exports = createMicrosoftUnsafeLocalFunction;
\No newline at end of file