(&mut self, _can_assign: bool)
| 2254 | } |
| 2255 | |
| 2256 | fn self_(&mut self, _can_assign: bool) -> Option<Expr<'gc>> { |
| 2257 | let is_in_static_method = if let Some(class_compiler) = self.class_compiler.as_ref() { |
| 2258 | class_compiler.current_method_type.is_static_method() || self.fn_type.is_static_method() |
| 2259 | } else { |
| 2260 | self.error("Can't use 'self' outside of a class or enum."); |
| 2261 | return None; |
| 2262 | }; |
| 2263 | |
| 2264 | if is_in_static_method { |
| 2265 | self.error("Can't use 'self' in static method."); |
| 2266 | return None; |
| 2267 | } |
| 2268 | |
| 2269 | Some(Expr::Self_ { |
| 2270 | line: self.previous.line, |
| 2271 | }) |
| 2272 | } |
| 2273 | |
| 2274 | fn prompt(&mut self, _can_assign: bool) -> Option<Expr<'gc>> { |
| 2275 | if !self.fn_type.is_ai_function() && self.fn_type != FunctionType::Script { |
nothing calls this directly
no test coverage detected