babel-source 5.4.3 → 5.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/babel.js +579 -613
- data/lib/babel/polyfill.js +19 -18
- data/lib/babel/source.rb +2 -2
- metadata +2 -2
data/lib/babel/polyfill.js
CHANGED
@@ -137,7 +137,7 @@ var $ = require('./$')
|
|
137
137
|
, set = $.set
|
138
138
|
, isObject = $.isObject
|
139
139
|
, hide = $.hide
|
140
|
-
,
|
140
|
+
, isExtensible = Object.isExtensible || isObject
|
141
141
|
, ID = safe('id')
|
142
142
|
, O1 = safe('O1')
|
143
143
|
, LAST = safe('last')
|
@@ -149,9 +149,9 @@ var $ = require('./$')
|
|
149
149
|
function fastKey(it, create){
|
150
150
|
// return primitive with prefix
|
151
151
|
if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it;
|
152
|
-
// can't set id to frozen object
|
153
|
-
if(isFrozen(it))return 'F';
|
154
152
|
if(!has(it, ID)){
|
153
|
+
// can't set id to frozen object
|
154
|
+
if(!isExtensible(it))return 'F';
|
155
155
|
// not necessary to add id
|
156
156
|
if(!create)return 'E';
|
157
157
|
// add missing object id
|
@@ -304,7 +304,7 @@ var $ = require('./$')
|
|
304
304
|
, _has = $.has
|
305
305
|
, isObject = $.isObject
|
306
306
|
, hide = $.hide
|
307
|
-
,
|
307
|
+
, isExtensible = Object.isExtensible || isObject
|
308
308
|
, id = 0
|
309
309
|
, ID = safe('id')
|
310
310
|
, WEAK = safe('weak')
|
@@ -355,21 +355,21 @@ module.exports = {
|
|
355
355
|
// 23.4.3.3 WeakSet.prototype.delete(value)
|
356
356
|
'delete': function(key){
|
357
357
|
if(!isObject(key))return false;
|
358
|
-
if(
|
358
|
+
if(!isExtensible(key))return leakStore(this)['delete'](key);
|
359
359
|
return _has(key, WEAK) && _has(key[WEAK], this[ID]) && delete key[WEAK][this[ID]];
|
360
360
|
},
|
361
361
|
// 23.3.3.4 WeakMap.prototype.has(key)
|
362
362
|
// 23.4.3.4 WeakSet.prototype.has(value)
|
363
363
|
has: function has(key){
|
364
364
|
if(!isObject(key))return false;
|
365
|
-
if(
|
365
|
+
if(!isExtensible(key))return leakStore(this).has(key);
|
366
366
|
return _has(key, WEAK) && _has(key[WEAK], this[ID]);
|
367
367
|
}
|
368
368
|
});
|
369
369
|
return C;
|
370
370
|
},
|
371
371
|
def: function(that, key, value){
|
372
|
-
if(
|
372
|
+
if(!isExtensible(assert.obj(key))){
|
373
373
|
leakStore(that).set(key, value);
|
374
374
|
} else {
|
375
375
|
_has(key, WEAK) || hide(key, WEAK, {});
|
@@ -1686,18 +1686,18 @@ $def($def.S, 'Math', {
|
|
1686
1686
|
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
|
1687
1687
|
hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars
|
1688
1688
|
var sum = 0
|
1689
|
-
,
|
1690
|
-
,
|
1691
|
-
, args = Array(
|
1689
|
+
, i = 0
|
1690
|
+
, len = arguments.length
|
1691
|
+
, args = Array(len)
|
1692
1692
|
, larg = 0
|
1693
1693
|
, arg;
|
1694
|
-
while(
|
1695
|
-
arg = args[
|
1694
|
+
while(i < len){
|
1695
|
+
arg = args[i] = abs(arguments[i++]);
|
1696
1696
|
if(arg == Infinity)return Infinity;
|
1697
1697
|
if(arg > larg)larg = arg;
|
1698
1698
|
}
|
1699
1699
|
larg = larg || 1;
|
1700
|
-
while(
|
1700
|
+
while(len--)sum += pow(args[len] / larg, 2);
|
1701
1701
|
return larg * sqrt(sum);
|
1702
1702
|
},
|
1703
1703
|
// 20.2.2.18 Math.imul(x, y)
|
@@ -2625,7 +2625,7 @@ var $ = require('./$')
|
|
2625
2625
|
, WEAK = weak.WEAK
|
2626
2626
|
, has = $.has
|
2627
2627
|
, isObject = $.isObject
|
2628
|
-
,
|
2628
|
+
, isExtensible = Object.isExtensible || isObject
|
2629
2629
|
, tmp = {};
|
2630
2630
|
|
2631
2631
|
// 23.3 WeakMap Objects
|
@@ -2633,7 +2633,7 @@ var WeakMap = require('./$.collection')('WeakMap', {
|
|
2633
2633
|
// 23.3.3.3 WeakMap.prototype.get(key)
|
2634
2634
|
get: function get(key){
|
2635
2635
|
if(isObject(key)){
|
2636
|
-
if(
|
2636
|
+
if(!isExtensible(key))return leakStore(this).get(key);
|
2637
2637
|
if(has(key, WEAK))return key[WEAK][this[ID]];
|
2638
2638
|
}
|
2639
2639
|
},
|
@@ -2646,10 +2646,11 @@ var WeakMap = require('./$.collection')('WeakMap', {
|
|
2646
2646
|
// IE11 WeakMap frozen keys fix
|
2647
2647
|
if($.FW && new WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
|
2648
2648
|
$.each.call(['delete', 'has', 'get', 'set'], function(key){
|
2649
|
-
var
|
2650
|
-
|
2649
|
+
var proto = WeakMap.prototype
|
2650
|
+
, method = proto[key];
|
2651
|
+
require('./$.redef')(proto, key, function(a, b){
|
2651
2652
|
// store frozen objects on leaky map
|
2652
|
-
if(isObject(a) &&
|
2653
|
+
if(isObject(a) && !isExtensible(a)){
|
2653
2654
|
var result = leakStore(this)[key](a, b);
|
2654
2655
|
return key == 'set' ? this : result;
|
2655
2656
|
// store all the rest on native weakmap
|
data/lib/babel/source.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babel-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian McKenzie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: sebmck@gmail.com
|