internal void HandleUndeclaredVariable(string name, IndexSpan span, LocationResolver indexResolver) { if (!HasAlreadySeenErrorFor(name)) { HandleError(JSError.UndeclaredVariable, span, indexResolver); } }
public EncodedSpan CombineWith(LocationResolver resolver, EncodedSpan otherSpan) { return(new EncodedSpan( resolver, GetSpan(resolver).CombineWith(otherSpan.GetSpan(resolver)) )); }
internal JScriptException(JSError errorNumber, IndexSpan span, LocationResolver resolver) { m_valueObject = null; _span = span; _resolver = resolver; m_errorCode = errorNumber; SetHResult(); }
public EncodedSpan(LocationResolver resolver, int start, int length) { if (start < (1 << _offsetBits) && length < (1 << _lengthBits)) { Span = start | (length << _offsetBits); } else { Span = resolver.AddSpan(start, length); } }
private ResolutionVisitor(ActivationObject rootScope, LocationResolver indexResolver, ErrorSink errorSink) { // create the lexical and variable scope stacks and push the root scope onto them m_lexicalStack = new Stack<ActivationObject>(); m_lexicalStack.Push(rootScope); m_variableStack = new Stack<ActivationObject>(); m_variableStack.Push(rootScope); _locationResolver = indexResolver; _errorSink = errorSink; }
public IndexSpan GetSpan(LocationResolver resolver) { if ((Span & 0x80000000) == 0) { return(new IndexSpan( Span & ((1 << _offsetBits) - 1), (Span >> _offsetBits) & ((1 << _lengthBits) - 1) )); } return(resolver._spans[(int)(Span & ~(0x80000000))]); }
private ResolutionVisitor(ActivationObject rootScope, LocationResolver indexResolver, ErrorSink errorSink) { // create the lexical and variable scope stacks and push the root scope onto them m_lexicalStack = new Stack <ActivationObject>(); m_lexicalStack.Push(rootScope); m_variableStack = new Stack <ActivationObject>(); m_variableStack.Push(rootScope); _locationResolver = indexResolver; _errorSink = errorSink; }
internal void HandleError(JSError errorId, IndexSpan span, LocationResolver resolver, bool forceToError = false) { var error = new JScriptException(errorId, span, resolver); if (forceToError) { error.IsError = true; } else { error.IsError = error.Severity < 2; } if (!OnCompilerError(error)) { } }
public static void Apply(Node node, ActivationObject scope, LocationResolver indexResolver, ErrorSink errorSink) { if (node != null && scope != null) { // create the visitor and run it. This will create all the child // scopes and populate all the scopes with the var-decl, lex-decl, // and lookup references within them. var visitor = new ResolutionVisitor(scope, indexResolver, errorSink); node.Walk(visitor); // now that all the scopes are created and they all know what decls // they contains, create all the fields visitor.CreateFields(scope); // now that all the fields have been created in all the scopes, // let's go through and resolve all the references visitor.ResolveLookups(scope); // now that everything is declared and resolved as per the language specs, // we need to go back and add ghosted fields for older versions of IE that // incorrectly implement catch-variables and named function expressions. visitor.AddGhostedFields(scope); } }
public int GetStartIndex(LocationResolver resolver) { return(GetSpan(resolver).Start); }
internal JsAst(EncodedSpan span, LocationResolver indexResolver) : base(span) { _locationResolver = indexResolver; }
public IndexSpan GetSpan(LocationResolver parent) { return(EncodedSpan.GetSpan(parent)); }
public EncodedSpan(LocationResolver resolver, IndexSpan span) : this(resolver, span.Start, span.Length) { }
public int GetStartIndex(LocationResolver parent) { return(GetSpan(parent).Start); }
public int GetEndIndex(LocationResolver resolver) { return(GetSpan(resolver).End); }
public IndexSpan GetNameSpan(LocationResolver resolver) { return(NameSpan); }
public int GetEndIndex(LocationResolver parent) { return(GetSpan(parent).End); }
internal SourceLocation GetStart(LocationResolver jsAst) { return(jsAst.IndexToLocation(GetSpan(jsAst).Start)); }
internal SourceLocation GetEnd(LocationResolver jsAst) { return(jsAst.IndexToLocation(GetSpan(jsAst).End)); }
public IndexSpan GetNameSpan(LocationResolver locationResolver) { return NameSpan; }
public IndexSpan GetNameSpan(LocationResolver locationResolver) { return(GetSpan(locationResolver)); }