These are chat archives for canjs/canjs

12th
Aug 2018
Dovid Bleier
@dbleier
Aug 12 2018 19:15
getting errors in built main.js can-reflect@1.17.2
  1. complains about nested functions in strict mode
  1. var Map not found
here is an excerpt of what is generated:
/*can-reflect@1.17.2#reflections/shape/shape*/
define('can-reflect@1.17.2#reflections/shape/shape', [
    'require',
    'exports',
    'module',
    'can-symbol',
    '../get-set/get-set',
    '../type/type',
    '../helpers'
], function (require, exports, module) {
    'use strict';
    var canSymbol = require('can-symbol');
    var getSetReflections = require('../get-set/get-set');
    var typeReflections = require('../type/type');
    var helpers = require('../helpers');
    var getPrototypeOfWorksWithPrimitives = true;
    try {
        Object.getPrototypeOf(1);
    } catch (e) {
        getPrototypeOfWorksWithPrimitives = false;
    }
    var ArrayMap;
    if (typeof Map === 'function') {
        ArrayMap = Map;
    } else {
        function isEven(num) {
            return !(num % 2);
        }
        ArrayMap = function () {
            this.contents = [];
        };
Notice the nest isEven function and the typeof Map === 'function' but nowhere is Map defined
Dovid Bleier
@dbleier
Aug 12 2018 19:24
and
    module.exports = function makeDelegateEventTree(domEvents) {
        var Delegator = makeDelegator(domEvents);
        return new KeyTree([
            Map,
            Delegator,
            Object,
            Array
        ]);
    };
Ivo Pinheiro
@ivospinheiro
Aug 12 2018 20:20
Thanks @justinbmeyer for the quick release.
Now I can try to upgrade the application to can@4 👍