@@ -26,7 +26,7 @@ import {
2626 BOUNDARY_EFFECT
2727} from './constants.js' ;
2828import { flush_tasks } from './dom/task.js' ;
29- import { internal_set , set } from './reactivity/sources.js' ;
29+ import { internal_set } from './reactivity/sources.js' ;
3030import {
3131 destroy_derived ,
3232 destroy_derived_effects ,
@@ -35,11 +35,12 @@ import {
3535} from './reactivity/deriveds.js' ;
3636import * as e from './errors.js' ;
3737import { FILENAME } from '../../constants.js' ;
38- import { legacy_mode_flag , tracing_mode_flag } from '../flags/index.js' ;
38+ import { tracing_mode_flag } from '../flags/index.js' ;
3939import { tracing_expressions , get_stack } from './dev/tracing.js' ;
4040import {
4141 component_context ,
4242 dev_current_component_function ,
43+ is_runes ,
4344 set_component_context ,
4445 set_dev_current_component_function
4546} from './context.js' ;
@@ -161,11 +162,6 @@ export function increment_write_version() {
161162 return ++ write_version ;
162163}
163164
164- /** @returns {boolean } */
165- export function is_runes ( ) {
166- return ! legacy_mode_flag || ( component_context !== null && component_context . l === null ) ;
167- }
168-
169165/**
170166 * Determines whether a derived or effect is dirty.
171167 * If it is MAYBE_DIRTY, will set the status to CLEAN
@@ -1095,35 +1091,6 @@ export function set_signal_status(signal, status) {
10951091 signal . f = ( signal . f & STATUS_MASK ) | status ;
10961092}
10971093
1098- /**
1099- * @template {number | bigint} T
1100- * @param {Value<T> } signal
1101- * @param {1 | -1 } [d]
1102- * @returns {T }
1103- */
1104- export function update ( signal , d = 1 ) {
1105- var value = get ( signal ) ;
1106- var result = d === 1 ? value ++ : value -- ;
1107-
1108- set ( signal , value ) ;
1109-
1110- // @ts -expect-error
1111- return result ;
1112- }
1113-
1114- /**
1115- * @template {number | bigint} T
1116- * @param {Value<T> } signal
1117- * @param {1 | -1 } [d]
1118- * @returns {T }
1119- */
1120- export function update_pre ( signal , d = 1 ) {
1121- var value = get ( signal ) ;
1122-
1123- // @ts -expect-error
1124- return set ( signal , d === 1 ? ++ value : -- value ) ;
1125- }
1126-
11271094/**
11281095 * @param {Record<string, unknown> } obj
11291096 * @param {string[] } keys
@@ -1215,37 +1182,3 @@ export function deep_read(value, visited = new Set()) {
12151182 }
12161183 }
12171184}
1218-
1219- if ( DEV ) {
1220- /**
1221- * @param {string } rune
1222- */
1223- function throw_rune_error ( rune ) {
1224- if ( ! ( rune in globalThis ) ) {
1225- // TODO if people start adjusting the "this can contain runes" config through v-p-s more, adjust this message
1226- /** @type {any } */
1227- let value ; // let's hope noone modifies this global, but belts and braces
1228- Object . defineProperty ( globalThis , rune , {
1229- configurable : true ,
1230- // eslint-disable-next-line getter-return
1231- get : ( ) => {
1232- if ( value !== undefined ) {
1233- return value ;
1234- }
1235-
1236- e . rune_outside_svelte ( rune ) ;
1237- } ,
1238- set : ( v ) => {
1239- value = v ;
1240- }
1241- } ) ;
1242- }
1243- }
1244-
1245- throw_rune_error ( '$state' ) ;
1246- throw_rune_error ( '$effect' ) ;
1247- throw_rune_error ( '$derived' ) ;
1248- throw_rune_error ( '$inspect' ) ;
1249- throw_rune_error ( '$props' ) ;
1250- throw_rune_error ( '$bindable' ) ;
1251- }
0 commit comments