mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-23 18:16:44 +00:00
![natecain](/assets/img/avatar_default.png)
This includes potentially breaking changes. Specifically, before this patch tiddlywiki would default to relative module identifiers Now, tiddlywiki will only search relative paths if explicitly specified Additionally, some "defaulted export contexts" were removed (some modules may make assumptions about context) Some unit tests were modified slightly from their originals Tiddlywiki doesn't have a notion of a "main" program's path Some require calls were explicitly made relative None of these changes should affect the requirement under test in each case
20 lines
388 B
JavaScript
20 lines
388 B
JavaScript
/*\
|
|
title: method/program.js
|
|
type: application/javascript
|
|
module-type: library
|
|
|
|
Method test
|
|
|
|
\*/
|
|
|
|
|
|
var test = require('test');
|
|
var a = require('./a');
|
|
var foo = a.foo;
|
|
test.assert(a.foo() == a, 'calling a module member');
|
|
test.assert(foo() == (function (){return this})(), 'members not implicitly bound');
|
|
a.set(10);
|
|
test.assert(a.get() == 10, 'get and set')
|
|
test.print('DONE', 'info');
|
|
|