mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-19 13:04:39 +08:00
This change makes it easier to run the script from directly `roll_py.deps` without having to fetch the dependencies first. This also makes it easier to track which dependencies our tooling have. Change-Id: I1ce55074ee6a1fffa6f2a2f05a56d0d74b4aca90 Bug: 1255619 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431346 Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Johan Bay <jobay@chromium.org>
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
import { Container } from "./container.js";
|
|
import { Constant } from "./constant.js";
|
|
import { Attribute } from "./attribute.js";
|
|
import { Operation } from "./operation.js";
|
|
import { stringifier } from "./helpers.js";
|
|
|
|
export class Mixin extends Container {
|
|
/**
|
|
* @typedef {import("../tokeniser.js").Token} Token
|
|
*
|
|
* @param {import("../tokeniser.js").Tokeniser} tokeniser
|
|
* @param {Token} base
|
|
* @param {object} [options]
|
|
* @param {Token} [options.partial]
|
|
*/
|
|
static parse(tokeniser, base, { partial } = {}) {
|
|
const tokens = { partial, base };
|
|
tokens.mixin = tokeniser.consume("mixin");
|
|
if (!tokens.mixin) {
|
|
return;
|
|
}
|
|
return Container.parse(
|
|
tokeniser,
|
|
new Mixin({ source: tokeniser.source, tokens }),
|
|
{
|
|
allowedMembers: [
|
|
[Constant.parse],
|
|
[stringifier],
|
|
[Attribute.parse, { noInherit: true }],
|
|
[Operation.parse, { regular: true }],
|
|
],
|
|
}
|
|
);
|
|
}
|
|
|
|
get type() {
|
|
return "interface mixin";
|
|
}
|
|
}
|