pub(crate) fn into_function(self, span: Span) -> Result<Function, CompileError> {
        let this = ManuallyDrop::new(self);

        let level = this
            .levels
            .borrow_mut()
            .pop()
            .ok_or_else(|| CompileError::msg(&span, "missing scope"))?;

        match level {
            IndexScopeLevel::IndexFunction(fun) => Ok(Function {
                generator: fun.generator,
                kind: fun.kind,
                has_await: fun.has_await,
            }),
            _ => Err(CompileError::msg(&span, "expected function")),
        }
    }
/// Pop the last function scope and return function information.
Pop the last function scope and return function information.
Pop the last function scope and return function information .
pub(crate) fn into_function(self, span: Span) -> Result<Function, CompileError> {
        let this = ManuallyDrop::new(self);
        let level = this
            .levels
            .borrow_mut()
            .pop()
            .ok_or_else(|| CompileError::msg(&span, "missing scope"))?;
        match level {
            IndexScopeLevel::IndexFunction(fun) => Ok(Function {
                generator: fun.generator,
                kind: fun.kind,
                has_await: fun.has_await,
            }),
            _ => Err(CompileError::msg(&span, "expected function")),
        }
    }
pub ( crate ) fn into_function ( self , span : Span ) -> Result < Function , CompileError > { let this = ManuallyDrop :: new ( self ) ; let level = this . levels . borrow_mut ( ) . pop ( ) . ok_or_else ( | | CompileError :: msg ( & span , " " ) ) ? ; match level { IndexScopeLevel :: IndexFunction ( fun ) => Ok ( Function { generator : fun . generator , kind : fun . kind , has_await : fun . has_await , } ) , _ => Err ( CompileError :: msg ( & span , " " ) ) , } }
Pop the last function scope and return function information.
Pop the last function scope and return function information .
self
span
Span
self
span
Span