main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 6 months ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
494 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var supportsDescriptors = require('has-property-descriptors')();
|
---|
4 | var defineDataProperty = require('define-data-property');
|
---|
5 |
|
---|
6 | var getPolyfill = require('./polyfill');
|
---|
7 |
|
---|
8 | module.exports = function shimStringTrim() {
|
---|
9 | var polyfill = getPolyfill();
|
---|
10 |
|
---|
11 | if (String.prototype.trim !== polyfill) {
|
---|
12 | if (supportsDescriptors) {
|
---|
13 | defineDataProperty(String.prototype, 'trim', polyfill, true);
|
---|
14 | } else {
|
---|
15 | defineDataProperty(String.prototype, 'trim', polyfill);
|
---|
16 | }
|
---|
17 | }
|
---|
18 |
|
---|
19 | return polyfill;
|
---|
20 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.