34 lines
852 B
JavaScript
34 lines
852 B
JavaScript
define([
|
|
'./defined'
|
|
], function(
|
|
defined) {
|
|
'use strict';
|
|
|
|
var definePropertyWorks = (function() {
|
|
try {
|
|
return 'x' in Object.defineProperty({}, 'x', {});
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
})();
|
|
|
|
/**
|
|
* Defines properties on an object, using Object.defineProperties if available,
|
|
* otherwise returns the object unchanged. This function should be used in
|
|
* setup code to prevent errors from completely halting JavaScript execution
|
|
* in legacy browsers.
|
|
*
|
|
* @private
|
|
*
|
|
* @exports defineProperties
|
|
*/
|
|
var defineProperties = Object.defineProperties;
|
|
if (!definePropertyWorks || !defined(defineProperties)) {
|
|
defineProperties = function(o) {
|
|
return o;
|
|
};
|
|
}
|
|
|
|
return defineProperties;
|
|
});
|