UNPKG

631 BJavaScriptView Raw
1/**
2 * Copyright (c) 2014, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
7 * additional grant of patent rights can be found in the PATENTS file in
8 * the same directory.
9 */
10
11import * as t from "babel-types";
12
13export function runtimeProperty(name) {
14 return t.memberExpression(
15 t.identifier("regeneratorRuntime"),
16 t.identifier(name),
17 false
18 );
19}
20
21export function isReference(path) {
22 return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node });
23}