Skip to content

Commit

Permalink
Merge pull request #1667 from lukastaegert/simple-object-shape-tracking
Browse files Browse the repository at this point in the history
Implement object shape and function return value tracking
  • Loading branch information
lukastaegert committed Nov 8, 2017
2 parents e773b58 + bc70d8d commit 70ad6ed
Show file tree
Hide file tree
Showing 353 changed files with 6,553 additions and 831 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -7,4 +7,6 @@ coverage
.commithash
.idea
bin/rollup
test/_tmp
test/_tmp
test/hooks/tmp
test/tmp
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -52,6 +52,7 @@
"date-time": "^2.1.0",
"eslint": "^4.4.1",
"eslint-plugin-import": "^2.2.0",
"immutable": "^3.8.1",
"is-reference": "^1.0.0",
"istanbul": "^0.4.3",
"locate-character": "^2.0.0",
Expand Down
6 changes: 2 additions & 4 deletions src/Bundle.js
Expand Up @@ -261,11 +261,9 @@ export default class Bundle {

this.modules.forEach( module => {
forOwn( module.scope.variables, variable => {
if ( variable.isDefault && variable.declaration.id ) {
return;
if ( !variable.isDefault || !variable.hasId ) {
variable.name = getSafeName( variable.name );
}

variable.name = getSafeName( variable.name );
} );

// deconflict reified namespaces
Expand Down
12 changes: 4 additions & 8 deletions src/Module.js
Expand Up @@ -32,7 +32,10 @@ function tryParse ( module, acornOptions ) {
}

function includeFully ( node ) {
node.includeInBundle();
node.included = true;
if ( node.variable && !node.variable.included ) {
node.variable.includeVariable();
}
node.eachChild( includeFully );
}

Expand Down Expand Up @@ -277,13 +280,6 @@ export default class Module {
for ( const node of this.ast.body ) {
node.bind();
}

// if ( this.declarations.default ) {
// if ( this.exports.default.identifier ) {
// const declaration = this.trace( this.exports.default.identifier );
// if ( declaration ) this.declarations.default.bind( declaration );
// }
// }
}

error ( props, pos ) {
Expand Down
15 changes: 15 additions & 0 deletions src/ast/CallOptions.js
@@ -0,0 +1,15 @@
export default class CallOptions {
static create ( callOptions ) {
return new this( callOptions );
}

constructor ( { withNew = false, args = [], caller } = {} ) {
this.withNew = withNew;
this.args = args;
this.caller = caller;
}

equals ( callOptions ) {
return callOptions && this.caller === callOptions.caller;
}
}

0 comments on commit 70ad6ed

Please sign in to comment.