These are chat archives for zloirock/core-js

30th
Apr 2015
Romeo Van Snick
@romeovs
Apr 30 2015 08:24
Ok one more thing.
Should String.prototype.lpad.call(null, 10) work? By turning the null into a string? It is specified like that in the spec but this might be my inpterpretation.
Romeo Van Snick
@romeovs
Apr 30 2015 08:32
ok is there a helper for this in core-js?
Romeo Van Snick
@romeovs
Apr 30 2015 08:38
that’s the $.assertDefined(that)?
Denis Pushkarev
@zloirock
Apr 30 2015 08:44
yep
Romeo Van Snick
@romeovs
Apr 30 2015 08:45
ok, should I also commit all the built files? eg client/core.min.js etc?
Denis Pushkarev
@zloirock
Apr 30 2015 08:46
not client path
Romeo Van Snick
@romeovs
Apr 30 2015 08:46
ok, and test/test-library.js (also a build file)?
Denis Pushkarev
@zloirock
Apr 30 2015 08:47
compiled tests - possible
Romeo Van Snick
@romeovs
Apr 30 2015 08:50
ok, my build passes on travis. should I do something more?
Denis Pushkarev
@zloirock
Apr 30 2015 08:51
library version tests are not correct, look at similar
Romeo Van Snick
@romeovs
Apr 30 2015 08:52
looked at string.at tests.
woops see what Idid
Romeo Van Snick
@romeovs
Apr 30 2015 08:58
fixed it
Denis Pushkarev
@zloirock
Apr 30 2015 09:07
Thanks.
Denis Pushkarev
@zloirock
Apr 30 2015 09:35
@romeovs looks like need fix or specify behavior in this case: 'abc'.rpad(4, 'de'), I will do it later. Also not sure about behavior with 32bit chars.
Romeo Van Snick
@romeovs
Apr 30 2015 10:04
yeah forgot to Math.ceil in the repeat
Denis Pushkarev
@zloirock
Apr 30 2015 10:06
Yep, but what result should be on 'abc'.lpad(4, 'de') - 'dabc' or 'eabc'?
Romeo Van Snick
@romeovs
Apr 30 2015 10:07
the spec is vague about that
“until it satisfies fillLen"
I interpret that as 'dabc'
Denis Pushkarev
@zloirock
Apr 30 2015 10:24
Because of these issues I didn't added these methods before :)
Romeo Van Snick
@romeovs
Apr 30 2015 10:25
Aha makes sense
C. Scott Ananian
@cscott
Apr 30 2015 13:02
I'm hoping that the spec is written such that '\uD83D\uDCA9'.lpad(3, '\uD83D\uDCA9') yields '\uD83D\uDCA9\uD83D\uDCA9\uD83D\uDCA9'
C. Scott Ananian
@cscott
Apr 30 2015 13:20
@zloirock is this spec-compliant:
> M = require('core-js/library/es6/map');
[Function]
> m = new Map();
{}
> m.set('a','b');
{}
> m.get('a')
'b'
> Object.freeze(m);
{}
> m.set('c','d');
{}
> m.get('c');
'd'
It matches what the native Map object seems to do in iojs, but still seems wrong. I'll have to check the spec.
C. Scott Ananian
@cscott
Apr 30 2015 15:14
Hm, seems like the spec writes to an internal [[MapData]] list, so the above behavior is spec-compliant. I wonder if there's a good way to make a read-only map (other than creating a wrapper).