Sens. Elizabeth Warren (D-Mass) and Bernie Sanders (I-Vt.), candidates for the Democratic nomination for president, agree: Gov. Ralph Northam (D) should take advantage of the state’s new Democratic legislative majorities and, in Sanders’s words, “Do the right thing. End ‘right-to-work.’”

The two offered their opinions in the wake of the governor’s remarks in support of Virginia’s 72-year-old law banning closed union workplaces.

They should have saved their breath.

Northam was never going to turn away from Virginia’s right-to-work law. Though its political roots go back to 1947, its philosophical foundations are as old as the Old Dominion itself.

In his 2013 book, “The Grandees of Government,” historian Brent Tarter wrote that Virginia’s “laws and practices since at least as early as the laws and orders of the first General Assembly in 1619 … regulated the lives of working people … for the advantage of owners and employers.”

And it was Virginia Democrats — led by Gov. William Tuck — who put the right -to-work law on the books. As William Crawley Jr. wrote in his 1978 biography of Tuck:

The acclaim which [Gov. Tuck] received for his handling of labor was owing mainly to the existence of a truculent antilabor atmosphere which allowed Tuck to lead Virginians in the direction most of them already wanted to go.

Tuck may have faded from memory, but the principles he put into law remain potent.

Northam made his support for right to work clear in the 2017 Democratic gubernatorial primary. Northam’s opponent, former congressman Tom Perriello, put repeal of right-to-work at the heart of his progressive-themed campaign.

In a debate hosted by the International Brotherhood of Electrical Workers, Perriello said the right-to-work law “undermine[d] the middle and working classes and was an anti-growth strategy.”

Northam pushed back:

“I think rather than pick fights that we perhaps can’t win right now, we need to talk about how can we help labor, how can we help with PLAs, which are project labor agreements. Those are very important to labor and unions right now.”

The contrast could not have been clearer between the two candidates — and Democratic voters responded by handing Northam a convincing primary win.

Granted, right-to-work was not the only issue that divided the two Democrats in 2017. But Northam’s primary win showed that repealing right-to-work had no statewide traction.

The question is how long it will stay that way.

The new argument in favor of the right-to-work law appears to be that it’s more than just an incentive for businesses to set down roots in Virginia, thus earning plaudits from cable news outlets.

Above all, the right-to-work law helps maintain the state’s hallowed AAA bond rating.

As the Richmond Times-Dispatch’s Michael Martz reported, at the same time Northam was pooh-poohing the idea of repealing the right-to-work law, the governor also “made clear he will not support any actions that could endanger Virginia’s Triple-A bond rating.”

Was that a warning to Democrats not to go on a spending spree as they take up debate over state budget in January? Absolutely. Balancing the commonwealth’s books and building the rainy day fund aren’t just budgetary niceties. They are key to keeping that AAA bond rating.

But Northam’s remarks also carry the very strong hint that the right-to-work law is part of the bigger economic picture — a point made explicit by Chamber of Commerce Chief Executive Barry DuVal, who said the right-to-work law and bond rating were “key components to Virginia’s economic competitiveness.”

That sentiment could have been expressed in Tuck’s day or, with modifications, in the first General Assembly meeting in Jamestown 400 years ago.

And neither drive-by tweets from presidential candidates nor untested Democratic legislative majorities in Richmond will change it.