Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | var has = require('./internals/has');
|
---|
| 2 | var isArray = require('./internals/is-array');
|
---|
| 3 | var isForced = require('./internals/is-forced');
|
---|
| 4 | var shared = require('./internals/shared-store');
|
---|
| 5 |
|
---|
| 6 | var data = isForced.data;
|
---|
| 7 | var normalize = isForced.normalize;
|
---|
| 8 | var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR';
|
---|
| 9 | var ASYNC_ITERATOR_PROTOTYPE = 'AsyncIteratorPrototype';
|
---|
| 10 |
|
---|
| 11 | var setAggressivenessLevel = function (object, constant) {
|
---|
| 12 | if (isArray(object)) for (var i = 0; i < object.length; i++) data[normalize(object[i])] = constant;
|
---|
| 13 | };
|
---|
| 14 |
|
---|
| 15 | module.exports = function (options) {
|
---|
| 16 | if (typeof options == 'object') {
|
---|
| 17 | setAggressivenessLevel(options.useNative, isForced.NATIVE);
|
---|
| 18 | setAggressivenessLevel(options.usePolyfill, isForced.POLYFILL);
|
---|
| 19 | setAggressivenessLevel(options.useFeatureDetection, null);
|
---|
| 20 | if (has(options, USE_FUNCTION_CONSTRUCTOR)) shared[USE_FUNCTION_CONSTRUCTOR] = !!options[USE_FUNCTION_CONSTRUCTOR];
|
---|
| 21 | if (has(options, ASYNC_ITERATOR_PROTOTYPE)) shared[USE_FUNCTION_CONSTRUCTOR] = options[ASYNC_ITERATOR_PROTOTYPE];
|
---|
| 22 | }
|
---|
| 23 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.