These are chat archives for canjs/canjs

13th
Aug 2018
Kevin Phillips
@phillipskevin
Aug 13 2018 14:09
what browser are you testing in?
Dovid Bleier
@dbleier
Aug 13 2018 19:02
@phillipskevin on the SSSP monitor, which only runs es5
but I am using babel to transpile
and what about the nested function which throws a strict mode error?
Kevin Phillips
@phillipskevin
Aug 13 2018 19:57
what throws in strict mode?
Dovid Bleier
@dbleier
Aug 13 2018 20:21
the function isEven(num) inside the else clause
also any idea why babel isn't transpiling the ES6 Map?
Kevin Phillips
@phillipskevin
Aug 13 2018 20:58
it doesn't transpile globals like that
  1. complains about nested functions in strict mode
can you show what you mean? what is complaining?
  1. var Map not found
why is this a problem?
this code is written specifically to handle the case where Map is not found
Dovid Bleier
@dbleier
Aug 13 2018 21:00
it crashes the app
give me min and I'll try to get the errors off the monitor
Kevin Phillips
@phillipskevin
Aug 13 2018 21:01
ok thanks
Dovid Bleier
@dbleier
Aug 13 2018 21:04
SyntaxError: Functions cannot be declared in a nested block in strict mode undefined:2859
Error loading "package.json!npm" at file:///opt/usr/apps/f36cF3Y1uF/res/wgt/dist/package.json
Error loading "bundles/menuboard-manager/main" at file:///opt/usr/apps/f36cF3Y1uF/res/wgt/dist/bundles/menuboard-manager/main.js
Error evaluating file:///opt/usr/apps/f36cF3Y1uF/res/wgt/dist/bundles/menuboard-manager/main.js
SyntaxError: Functions cannot be declared in a nested block in strict mode
Kevin Phillips
@phillipskevin
Aug 13 2018 21:07
ok
Dovid Bleier
@dbleier
Aug 13 2018 21:08
Error
line: 33153
message: "Error loading "menuboard-manager@6.4.10#main" at file:///opt/usr/apps/f36cF3Y1uF/res/wgt/dist/src/main.jsā†µCan't find variable: Map"
if you want I can include the stack trace
Kevin Phillips
@phillipskevin
Aug 13 2018 21:09
that one I don't understand
Dovid Bleier
@dbleier
Aug 13 2018 21:10
this was working before, so I assume when we deleted the node_modules and reinstalled the dependencies, it upped the version of can-reflect and can-dom-events
that was the one in makeDelegateEventTree
I guess because it's putting it in the array for the KeyTree
Kevin Phillips
@phillipskevin
Aug 13 2018 21:12
oh, I see
I thought it was the typeof Map === 'function' in the first snippet you gave
Dovid Bleier
@dbleier
Aug 13 2018 21:14
I thought so too at first, but then I saw it was the other one
Kevin Phillips
@phillipskevin
Aug 13 2018 21:20
ok
there is an issue to add support for older browsers: canjs/canjs#4115
which will cover these
obviously that doesn't help you much right now
Dovid Bleier
@dbleier
Aug 13 2018 21:23
that will help the Map issue, what about the function isEven?
is it just me or if it was isEven = function() then it wouldn't complain?
Kevin Phillips
@phillipskevin
Aug 13 2018 21:26
yeah, that's an easy fix
we'll fix that too when we do the IE11 issue since I'm sure IE11 will break due to that also
or if you want to submit a PR, I'm happy to release it now
or submit a separate issue and we can get it fixed quickly
Dovid Bleier
@dbleier
Aug 13 2018 21:29
where would I submit the PR?
uh-oh travis failed
Kevin Phillips
@phillipskevin
Aug 13 2018 21:38
missing semi-colon?
oh, sauce labs issue
Dovid Bleier
@dbleier
Aug 13 2018 21:38
yeah
Kevin Phillips
@phillipskevin
Aug 13 2018 21:39
now I'm confused..
we are testing IE9+ with can-reflect
Dovid Bleier
@dbleier
Aug 13 2018 21:40
added missing semi-colon
any suggestions about the Map until the issue is handled, aside from manually commenting out that line after each build?
getting pretty late here. I'll check back in with you tomorrow
Kevin Phillips
@phillipskevin
Aug 13 2018 21:45
you could add a polyfill
like babel-polyfill or core.js
Dovid Bleier
@dbleier
Aug 13 2018 21:46
where would I add that so it is picked up by can-reflect?
Kevin Phillips
@phillipskevin
Aug 13 2018 21:53
as early as you can?
you could make it a dependency of your main: https://stealjs.com/docs/load.metadata.html
sorry, there's not a great solution at the moment
Dovid Bleier
@dbleier
Aug 13 2018 21:55
ok, I'll take a look at that... tomorrow :sleeping:
thanks for your help, and let me know about the PR
I guess I am now a canjs contributor :smile: