Skip to content

Commit

Permalink
fixup! test(ivy): switch HelloWorld to ivy compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Mar 19, 2018
1 parent 3453ac1 commit f0bcd9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Expand Up @@ -2,9 +2,9 @@ workspace(name = "angular")

http_archive(
name = "build_bazel_rules_nodejs",
url = "https://github.com/mhevery/rules_nodejs/archive/07c2cf1f04fa7b68220d730bc8df37ee9811b5e8.zip",
strip_prefix = "rules_nodejs-07c2cf1f04fa7b68220d730bc8df37ee9811b5e8",
sha256 = "7dbdec2d73a83fd0a34dbe3b459b810fd0b3e580152bc3fcd339784ad4dae988",
url = "https://github.com/bazelbuild/rules_nodejs/archive/25bb70fb67bddcc257b869f434ccc0fd130ec3bd.zip",
strip_prefix = "rules_nodejs-25bb70fb67bddcc257b869f434ccc0fd130ec3bd",
sha256 = "11c0d73bdcb4b2608abbe5967be5a910bdaebf848eb13e4e7f8413bbdeb940b8",
)

load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/render3/component.ts
Expand Up @@ -140,7 +140,7 @@ export function renderComponent<T>(
try {
// Create element node at index 0 in data array
elementNode = hostElement(hostNode, componentDef);
// Create directive instance with n() and store at index 1 in data array (el is 0)
// Create directive instance with factory() and store at index 1 in data array (el is 0)
component = rootContext.component =
baseDirectiveCreate(1, componentDef.factory(), componentDef) as T;
initChangeDetectorIfExisting(elementNode.nodeInjector, component);
Expand Down
10 changes: 4 additions & 6 deletions tools/symbol-extractor/symbol_extractor.ts
Expand Up @@ -32,6 +32,7 @@ export class SymbolExtractor {
if (fnRecurseDepth <= 1) {
ts.forEachChild(child, visitor);
}
fnRecurseDepth--;
break;
case ts.SyntaxKind.SourceFile:
case ts.SyntaxKind.VariableStatement:
Expand All @@ -48,7 +49,7 @@ export class SymbolExtractor {
if (varDecl.initializer && fnRecurseDepth !== 0) {
symbols.push({name: varDecl.name.getText()});
}
if (fnRecurseDepth == 0 && isStoringIIFE(child.parent as ts.VariableDeclarationList)) {
if (fnRecurseDepth == 0 && isRollupExportSymbol(child.parent as ts.VariableDeclarationList)) {
ts.forEachChild(child, visitor);
}
break;
Expand Down Expand Up @@ -125,11 +126,8 @@ function toName(symbol: Symbol): string {
* Rollup produces this format when it wants to export symbols from a bundle.
* @param child
*/
function isStoringIIFE(child: ts.VariableDeclarationList): boolean {
function isRollupExportSymbol(child: ts.VariableDeclarationList): boolean {
if (child.declarations.length !== 1) return false;
const decl: ts.VariableDeclaration = child.declarations[0];
if (decl.initializer && decl.initializer.kind == ts.SyntaxKind.CallExpression) {
return true;
}
return false;
return (decl.initializer && decl.initializer.kind == ts.SyntaxKind.CallExpression);
}
Expand Up @@ -5,6 +5,11 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

/**
* Rollup exports symbols in this particular way. This test demonstrates that we can correctly read
* symbols.
*/
var fooBar = function(exports) {
'use strict';
// tslint:disable-next-line:no-console
Expand Down

0 comments on commit f0bcd9b

Please sign in to comment.