Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8fb2dd6ad8
20
resource/js-impl.js
Normal file
20
resource/js-impl.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
var resourceType = MACHINE.modules['whalesong/resource/structs.rkt'].getNamespace()['struct:resource'];
|
||||
|
||||
var makePrimitiveProcedure = plt.baselib.functions.makePrimitiveProcedure;
|
||||
|
||||
var checkResource = plt.baselib.check.makeCheckArgumentType(
|
||||
resourceType.predicate,
|
||||
"resource");
|
||||
|
||||
var getResourcePath = function(r) { return resourceType.accessor(r, 0); };
|
||||
var getResourceKey = function(r) { return resourceType.accessor(r, 1); };
|
||||
|
||||
|
||||
|
||||
EXPORTS['resource->url'] = makePrimitiveProcedure(
|
||||
'resource->url',
|
||||
1,
|
||||
function(MACHINE) {
|
||||
var resource = checkResource(MACHINE, 'resource->url', 0);
|
||||
return "res/" + String(getResourceKey(resource));
|
||||
});
|
Loading…
Reference in New Issue
Block a user