GithubHelp home page GithubHelp logo

constellation / az Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 624 KB

ECMAScript analyzing tools

Home Page: http://d.hatena.ne.jp/Constellation/

Vim Script 0.45% C 20.19% C++ 77.02% Rust 0.47% JavaScript 1.88%

az's People

Contributors

constellation avatar herumi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

az's Issues

object literal to this value

if target script is

var obj = {
  v: 10,
  publicMethod: function() {
    this.<COMPLETION>
  }
}

publicMethod function's this value (not called) to obj and complete it.

add new pass: JSDoc Collector

add JSDocCollector pass and rm jsdoc code in BindingResolver.
and, add TypeExpression Identifier resolve code to BindingResolver, so use it in Interpreter

broken object literal completion

if target script is,

var obj = {
  x: 10,
  y: 20,
  t: function() {
    this.<COMPLETION>

obj is broken, so function target t is not bound to object.

=> handling ObjectLiteral?

type expression ObjectLiteral

type expression ObjectLiteral is following,

{ { test: string } }

so, we should parse type expression with balancing BRACE( { / } )

prototype function specialization

if target script is such as,

function Test() {
  this.value = "OK";
}

Test.prototype.getValue = function() {
  return this.value;
}

and, if getValue is not used in this function, now AbstractInterpreter calls getValue with this value undefined.
but, if we use completion in function getValue, this is not Test instance.

use line/column information for completion

now, using byte offset information for completion.
but, if we use multibyte character like "おはよーおはよー", byteoffset and UTF-16 offset is not the same and cannot provide completion results.
so, use line/column information for completion.

use @param information

if we get the code like,

/**
 * @param {function(string)} arg1
 */
function callLater(func) { }

and use it like,

callLater(funciton(target) {
  target.<COMPLETION>

add string type information to target

when expr is broken, completion is not executed

such as:

var obj = {
  target: function() {
    var o = { test: "OK" };
    o.<COMPLETION POINT>

completion is not fired.

because, ObjectLiteral expression is broken, so not defined in Recovery AST.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.