Skip to content

Commit

Permalink
Convert other packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Feb 9, 2022
1 parent 741e602 commit ca611b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/babel-core/package.json
Expand Up @@ -67,12 +67,12 @@
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "workspace:^",
"@babel/plugin-transform-modules-commonjs": "workspace:^",
"@jridgewell/trace-mapping": "^0.3.2",
"@types/convert-source-map": "^1.5.1",
"@types/debug": "^4.1.0",
"@types/resolve": "^1.3.2",
"@types/semver": "^5.4.0",
"@types/source-map": "^0.5.0",
"source-map": "0.6.1"
"@types/source-map": "^0.5.0"
},
"conditions": {
"BABEL_8_BREAKING": [
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-core/test/api.js
@@ -1,5 +1,5 @@
import babel from "../lib/index.js";
import sourceMap from "source-map";
import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
import path from "path";
import generator from "@babel/generator";
import { fileURLToPath } from "url";
Expand Down Expand Up @@ -532,10 +532,10 @@ describe("api", function () {
].join("\n"),
).toBe(result.code);

const consumer = new sourceMap.SourceMapConsumer(result.map);
const consumer = new TraceMap(result.map);

expect(
consumer.originalPositionFor({
originalPositionFor(consumer, {
line: 7,
column: 4,
}),
Expand Down
1 change: 1 addition & 0 deletions packages/babel-generator/package.json
Expand Up @@ -26,6 +26,7 @@
"devDependencies": {
"@babel/helper-fixtures": "workspace:^",
"@babel/parser": "workspace:^",
"@jridgewell/trace-mapping": "^0.3.2",
"@types/jsesc": "^2.5.0",
"@types/source-map": "^0.5.0",
"charcodes": "^0.2.0"
Expand Down
10 changes: 5 additions & 5 deletions packages/babel-generator/test/index.js
Expand Up @@ -3,7 +3,7 @@ import * as t from "@babel/types";
import fs from "fs";
import path from "path";
import fixtures from "@babel/helper-fixtures";
import sourcemap from "source-map";
import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
import { fileURLToPath } from "url";

import _Printer from "../lib/printer.js";
Expand Down Expand Up @@ -295,8 +295,8 @@ describe("generation", function () {
code,
);

const consumer = new sourcemap.SourceMapConsumer(generated.map);
const loc = consumer.originalPositionFor({ line: 2, column: 1 });
const consumer = new TraceMap(generated.map);
const loc = originalPositionFor(consumer, { line: 2, column: 1 });
expect(loc).toMatchObject({
column: 0,
line: 2,
Expand All @@ -316,8 +316,8 @@ describe("generation", function () {
code,
);

const consumer = new sourcemap.SourceMapConsumer(generated.map);
const loc = consumer.originalPositionFor({ line: 2, column: 1 });
const consumer = new TraceMap(generated.map);
const loc = originalPositionFor(consumer, { line: 2, column: 1 });
expect(loc).toMatchObject({
column: 0,
line: 2,
Expand Down

0 comments on commit ca611b2

Please sign in to comment.