Skip to content

Commit 08bba93

Browse files
authored
Merge PR #14: The #= on Symbol and String should be symmetric
2 parents d825cf0 + afe38e8 commit 08bba93

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

som.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ pushd `dirname $0` > /dev/null
33
SCRIPT_PATH=`pwd`
44
popd > /dev/null
55

6-
git --work-tree=${SCRIPT_PATH} submodule update --init --recursive > /dev/null 2>&1
6+
if [ ! -f "${SCRIPT_PATH}/core-lib/.git" ]
7+
then
8+
echo Initializing core-lib submodule to have access to the required standard library
9+
git --work-tree=${SCRIPT_PATH} submodule update --init --recursive > /dev/null 2>&1
10+
fi
711

812
exec node ${SCRIPT_PATH}/src/node.js "$@"

src/som/primitives/SymbolPrimitives.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import { Primitives } from './Primitives.js';
2525

2626
import { universe } from '../vm/Universe.js';
27+
import { SString } from '../vmobjects/SString.js';
2728

2829
function _asString(_frame, args) {
2930
return universe.newString(args[0].getString());
@@ -35,6 +36,10 @@ function _equals(_frame, args) {
3536
if (op1 === op2) {
3637
return universe.trueObject;
3738
}
39+
40+
if (op1 instanceof SString && op1.getEmbeddedString() === op2.getEmbeddedString()) {
41+
return universe.trueObject;
42+
}
3843
return universe.falseObject;
3944
}
4045

0 commit comments

Comments
 (0)