Skip to content

Conversation

@Vladlukhanin
Copy link
Contributor

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это точно нужно оставлять?

js/qbUtils.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можешь пояснить эту строку? Можешь комментирий /** оставить, что ты тут делаешь?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var listenerCall = Array.prototype.shift.apply(arguments);

Тут вырезаем из псевдомассива arguments первый элемент и сразу присваиваем в listenerCall, нам нужна функция (arguments[0] - это будет та самая функция, которая пришла в аргументах. Если её передать последним элементом, то аналогом было бы var listenerCall = Array.prototype.pop.apply(arguments);). В arguments теперь останутся только аргументы (без функции)

@dimaspirit
Copy link
Contributor

Пришли к тому, что лучше скопировать args в массив и с ним работать, т.к agrs и параметры ссылаються на одну ячейку памяти и могут быть не явные проблемы.

js/qbUtils.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (var i = 0; i < arguments.length; i++) {
argumentsArr.push(arguments[i]);
}

listenerCall = argumentsArr.shift();

вынести это из try - нам нужно только call проверить, так?

Может вместо argumentsArr назвать argumentsCopy,логичней звучит)

js/qbUtils.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы разве оставляем console?
У нас вроде QBLog есть или что то такое. Которое следит за параметром debug конфига и пишит.

@dimaspirit
Copy link
Contributor

soulfly pushed a commit that referenced this pull request Nov 9, 2015
@soulfly soulfly merged commit 3ecb9d0 into develop Nov 9, 2015
@soulfly soulfly deleted the develop.try-catch branch November 17, 2015 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants