mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
26 lines
673 B
JavaScript
26 lines
673 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
/* globals MSApp */
|
|
|
|
/**
|
|
* Create a function which has 'unsafe' privileges (required by windows8 apps)
|
|
*/
|
|
const createMicrosoftUnsafeLocalFunction = function(func) {
|
|
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
|
return function(arg0, arg1, arg2, arg3) {
|
|
MSApp.execUnsafeLocalFunction(function() {
|
|
return func(arg0, arg1, arg2, arg3);
|
|
});
|
|
};
|
|
} else {
|
|
return func;
|
|
}
|
|
};
|
|
|
|
export default createMicrosoftUnsafeLocalFunction;
|