(Object x, StarlarkThread thread)
| 163 | } |
| 164 | |
| 165 | @StarlarkMethod( |
| 166 | name = "freeze", |
| 167 | doc = "Shallow-freezes the operand. With no argument, freezes the thread.", |
| 168 | parameters = {@Param(name = "x", defaultValue = "unbound")}, |
| 169 | useStarlarkThread = true) |
| 170 | public void freeze(Object x, StarlarkThread thread) throws EvalException { |
| 171 | if (x == Starlark.UNBOUND) { |
| 172 | thread.mutability().close(); |
| 173 | return; |
| 174 | } |
| 175 | |
| 176 | if (x instanceof Mutability.Freezable) { |
| 177 | ((Mutability.Freezable) x).unsafeShallowFreeze(); |
| 178 | } else { |
| 179 | throw Starlark.errorf("%s value is not freezable", Starlark.type(x)); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | @StarlarkMethod( |
| 184 | name = "int_mul_slow", |
nothing calls this directly
no test coverage detected