(ordinary, stmt, isfunc, isfatarrow, iscase)
| 3982 | } |
| 3983 | } |
| 3984 | function block(ordinary, stmt, isfunc, isfatarrow, iscase) { |
| 3985 | var a, |
| 3986 | b = inblock, |
| 3987 | old_indent = indent, |
| 3988 | m, |
| 3989 | s = scope, |
| 3990 | t, |
| 3991 | line, |
| 3992 | d; |
| 3993 | |
| 3994 | inblock = ordinary; |
| 3995 | |
| 3996 | if (!ordinary || !state.option.funcscope) |
| 3997 | scope = Object.create(scope); |
| 3998 | |
| 3999 | t = state.tokens.next; |
| 4000 | |
| 4001 | var metrics = funct["(metrics)"]; |
| 4002 | metrics.nestedBlockDepth += 1; |
| 4003 | metrics.verifyMaxNestedBlockDepthPerFunction(); |
| 4004 | |
| 4005 | if (state.tokens.next.id === "{") { |
| 4006 | advance("{"); |
| 4007 | funct["(blockscope)"].stack(); |
| 4008 | |
| 4009 | line = state.tokens.curr.line; |
| 4010 | if (state.tokens.next.id !== "}") { |
| 4011 | indent += state.option.indent; |
| 4012 | while (!ordinary && state.tokens.next.from > indent) { |
| 4013 | indent += state.option.indent; |
| 4014 | } |
| 4015 | |
| 4016 | if (isfunc) { |
| 4017 | m = {}; |
| 4018 | for (d in state.directive) { |
| 4019 | if (_.has(state.directive, d)) { |
| 4020 | m[d] = state.directive[d]; |
| 4021 | } |
| 4022 | } |
| 4023 | directives(); |
| 4024 | |
| 4025 | if (state.option.strict && funct["(context)"]["(global)"]) { |
| 4026 | if (!m["use strict"] && !state.directive["use strict"]) { |
| 4027 | warning("E007"); |
| 4028 | } |
| 4029 | } |
| 4030 | } |
| 4031 | |
| 4032 | a = statements(); |
| 4033 | |
| 4034 | metrics.statementCount += a.length; |
| 4035 | |
| 4036 | if (isfunc) { |
| 4037 | state.directive = m; |
| 4038 | } |
| 4039 | |
| 4040 | indent -= state.option.indent; |
| 4041 | } |
no test coverage detected